我想用 versions-maven-plugin
更改我的多模块项目的版本和目标versions:set
在 Eclipse 中。我用 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
if Maven should attempt to interact with the user for input,false
if not. Defaults totrue
.
最佳答案
我找到了解决方法,请参阅 How to make Eclipse prompt me for command line arguments .
我必须这样定义系统属性
-DnewVersion=${string_prompt:new version}
在 Eclipse 中启动启动配置后,我会看到一个输入新版本的对话框。然后 versions-maven-plugin
使用对话框中的版本。
关于java - 使用 M2Eclipse 插件在交互模式下使用 versions-maven-plugin 设置版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34023334/