【发布时间】: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