我有一个Maven(3.0.4)项目,其中处理一些外部资源,并使用在配置文件中定义的一些属性进行过滤。
当我启动程序插件时(无论是手动还是挂钩到某个阶段),似乎maven-resource-plugin没有考虑命令行指定的活动配置文件。因此,与指定配置文件中定义的属性相关的标记没有被替换。
如果我定义了一个activeByDefault配置文件,则即使通过命令行指定另一个配置文件,也会将其视为活动配置文件...
以下是示例:
当我启动程序插件时(无论是手动还是挂钩到某个阶段),似乎maven-resource-plugin没有考虑命令行指定的活动配置文件。因此,与指定配置文件中定义的属性相关的标记没有被替换。
如果我定义了一个activeByDefault配置文件,则即使通过命令行指定另一个配置文件,也会将其视为活动配置文件...
以下是示例:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-script</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/bash</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
...
<profiles>
<profile>
<id>staging</id>
<properties>
<remote.url>some_stag_value</remote.url>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<remote.url>some_prod_value</remote.url>
</properties>
</profile>
</profiles>