我遇到了从[多模块项目]的超级Pom传递属性到子POM的问题。获取在子模块内部的父POM中定义的属性[多模块项目]
目前我有以下文件: superpom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>...</groupId>
<artifactId>meta-all</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<properties>
<databasedriver>net.sourceforge.jtds.jdbc.Driver</databasedriver>
</properties>
<modules>
<module>child1</module>
</modules>
</project>
孩子POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>...</groupId>
<artifactId>child1</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<!-- JDBC Driver -->
<dependencies>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.3.1</version>
</dependency>
</dependencies>
<configuration>
<driver>${project.parent.databasedriver}</driver>
...
<autocommit>true</autocommit>
<delimiter>GO</delimiter>
<delimiterType>row</delimiterType>
</configuration>
<executions>
Howeve,我不知道为什么我不能得到的插件配置来检索超级pom的属性。
您是否尝试在您的孩子pom中使用$ {databasedriver}? –