[英]maven assembly plugin and profiles
I have a Maven (3.0.4) project in which process some external resources, and filtering them using some properties defined in a profile. 我有一个Maven(3.0.4)项目,该项目中处理一些外部资源,并使用配置文件中定义的某些属性对其进行过滤。
When I launch the assembly plugin (either manually or hooked to a phase) it seems that maven-resource-plugin does not consider active the profile specified by command line. 当我启动程序集插件时(手动或挂接到某个阶段),看来maven-resource-plugin不会将命令行指定的配置文件视为活动的。 In this way the tokens which relate to the properties defined in the specified profile are not replaced.
这样,与指定配置文件中定义的属性相关的令牌不会被替换。
If I define a profile activeByDefault this is considered to be active even if another is specified by command line... 如果我定义了一个配置文件activeByDefault,即使命令行指定了另一个配置文件,它也被认为是活动的...
This is the example: 这是示例:
<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>
Try deactivating the profile using !
尝试使用
!
停用配置文件!
: :
mvn groupId:artifactId:goal -P profile_you_want !default_profile
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.