I want to change the version of my multi module project with versions-maven-plugin and goal versions:set in Eclipse. I use M2Eclipse.
I can set the new version with -DnewVersion=0.0.2-SNAPTSHOT in the launch configuration and it works fine. But I want to use the interactive mode.
If I don't set -DnewVersion=0.0.2-SNAPTSHOT in launch configuration, I get following error message:
[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]
Maven Settings Reference says:
- interactiveMode:
trueif Maven should attempt to interact with the user for input,falseif not. Defaults totrue.
I found a work-around, see How to make Eclipse prompt me for command line arguments.
I have to define system property like this
-DnewVersion=${string_prompt:new version}
and after starting the launch configuration in Eclipse, I get a dialog to enter the new version. Then versions-maven-plugin uses the version from dialog.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With