maven release plugin忽略releaseProfile

Jan*_*ing 11 maven-2

我使用两个配置文件:开发和生产.

开发应在默认情况下有效; 我发布时应该使用生产.

在我的pom.xml中,我有:

[...]
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-9</version>
<configuration>
  <useReleaseProfile>false</useReleaseProfile>
  <goals>deploy</goals>
  <arguments>-Pproduction</arguments>
</configuration>
</plugin>
[...]
<profiles>
  <profile>
    <id>production</id>
    <properties>
      <profile.name>production</profile.name>
    </properties>
    [...]
  </profile>
  <profile>
    <id>development</id>
    <activation>
      <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
    <profile.name>development</profile.name>
    </properties>
       [...]
  </profile>
[...]
Run Code Online (Sandbox Code Playgroud)

它只是不起作用.
useReleaseProfiles也不起作用:http: //jira.codehaus.org/browse/MRELEASE-459

开发配置文件应始终处于活动状态,但在运行时不应mvn release:perform.你是如何实现这一目标的?

[更新]:我已经看到调试标志使用了我的生产配置文件,但也使用了开发配置文件,因为它是activeByDefault.这个releaseProfile论点无法改写.强制释放插件使用"生产"配置文件会很好.

dev*_*nke 15

maven-release-plugin 文档鼓励使用releaseProfiles配置参数在发布过程中自动调用配置文件.

这是比从命令行手动调用发布配置文件更好的方法.原因之一是,发布中使用的配置文件将记录在pom.xml标记代码中并与之一起存储.这使得构建过程更容易理解,以后更容易重复,与项目最初发布的方式完全相同.

如果使用maven-release-plugin旧版本,2.4请查看此错误,以防止使用上述参数.

请注意,在多模块项目的情况下,您必须将"releaseProfiles"配置放在根pom中!有关更多信息,请参阅此问题.