我在父 pom.xml 和子 pom.xml 中定义了配置文件,但是当我尝试mvn install -P profile name
从父项目运行时,配置文件中定义的属性没有被复制
我的父 pom.xml 看起来像:
<dependencies>
<dependency>
<groupId>xxx</groupId>
<artifactId>xxx</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>pom</type>
</dependency>
</dependencies>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>verify</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes</outputDirectory> <resources>
<resource>
<directory>deployment/${environment}</directory>
</resource>
</resources>
</configuration>
</execution>
</plugin>
我的孩子 pom.xml:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>verify</phase>
<goals>
<goal>copy-resources</goal>
</goals>
</execution>
</plugin>