【问题标题】:Maven profile activation in interactive mode交互模式下的 Maven 配置文件激活
【发布时间】:2018-12-17 08:16:32
【问题描述】:

我有一个包含多个模块的 Maven 项目,我只想在版本管理中包含模块。这个解决方案对我有用。

<profiles>
  <profile>
    <id>version</id>
    <activation>
      <property>
        <name>newVersion</name>
      </property>
    </activation>
    <modules>
      <module>module-to-include</module>
    </modules>
  </profile>
</profiles>
<modules>
  <module>module-1</module>
  <module>module-2</module>
</modules>

只有在 mvn 命令行中传递 -DnewVerison=x.x.x 时才有效。 但在更复杂的情况下,例如使用交互模式设置版本或还原版本,它不起作用。请问有什么建议吗?

配置文件管理必须在pom文件中,在命令行中传递-P参数必须隐式完成。

【问题讨论】:

    标签: maven maven-profiles


    【解决方案1】:

    很遗憾,不能从命令行以外的任何地方启用配置文件。见this answer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-05
      • 1970-01-01
      • 1970-01-01
      • 2011-11-12
      • 2014-10-29
      • 1970-01-01
      • 2018-07-03
      • 2015-03-30
      相关资源
      最近更新 更多