|
The Java VM itself provides the following options: -version -----> print product version and exit -version:<value> -----> require the specified version to run -showversion -----> print product version and continue Consider providing the same options in Maven. (comment edited: apparently Confluence table syntax isn't supported) I would be satisfied with -showversion, if Maven developers must keep the current semantics of -version New options: mvn -V clean will show the maven, java, etc. versions without stopping the build. The original -v option will remain intact and unmodified to keep from causing problems with scripted maven executions, etc. Adding fix-for for both 2.0.10 and 2.1.0-M1, since 2.1.0-M1 will actually be released first and may not incorporate all of the eventual issue fixes released in 2.0.10. Was reverted from 2.0.x branch in r688884 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I believe the fix is easy. Two use cases have to be supported:
1) If --version and no phase specified, then print version and quit. This prevents the "You must specify at least one goal" message.
2) If --version and phase(s) specified, then print version and continue.
The change needs to be made in org.apache.maven.cli.MavenCli
Line 142 has this:
if ( commandLine.hasOption( CLIManager.VERSION ) )
{
showVersion();
if ( // *** Add second condition ) { return 0; }
}