我有dev / XYZ.properties文件,我正在使用maven -P dev install构建一个jar文件。如何将属性文件放在child.jar / META-INF / XYZ.properties文件
中答案 0 :(得分:0)
您必须为您的个人资料maven-resources-plugin:copy-resources
执行dev
目标并将其与相应的阶段绑定(process-resources
似乎是我的最佳阶段)。以下是如何定义您的个人资料dev
:
<profile>
<id>dev</id>
...
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/classes/META-INF</outputDirectory>
<resources>
<resource>
<directory>${basedir}/dev</directory>
<includes>
<include>XYZ.properties</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>