我想在Eclipse中使用versions-maven-plugin
和目标versions:set
更改我的多模块项目的版本。我使用M2Eclipse。
我可以在启动配置中使用-DnewVersion=0.0.2-SNAPTSHOT
设置新版本,它可以正常工作。但我想使用交互模式。
如果我没有在启动配置中设置-DnewVersion=0.0.2-SNAPTSHOT
,我会收到以下错误消息:
[ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.2:set (default-cli) on project test-parent: You must specify the new version, either by using the newVersion property (that is -DnewVersion=... on the command line) or run in interactive mode -> [Help 1]
- interactiveMode :
true
如果Maven应该尝试与用户进行交互以进行输入,false
如果没有。默认为true
。
答案 0 :(得分:9)
我找到了解决办法,请参阅How to make Eclipse prompt me for command line arguments。
我必须像这样定义系统属性
-DnewVersion=${string_prompt:new version}
在Eclipse中启动启动配置后,我得到一个对话框来输入新版本。然后versions-maven-plugin
使用对话框中的版本。
答案 1 :(得分:2)