Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.8
-
Fix Version/s: 2.1.0-M1
-
Component/s: Bootstrap & Build, Command Line
-
Labels:None
-
Number of attachments :
Description
I wanted to always print the Maven version when I build, but unfortunately Maven immediately quits after outputting the version. This option should not quit when a lifecycle is also specified. Example: mvn -v install
Issue Links
- is related to
-
MNG-4411
[regression] Maven execution does not stop after showing version
-
-
MNG-3509
Make "mvn -v" output locale/encoding
-
- relates to
-
MINVOKER-92
Add support for show version option ( -V,--show-version)
-
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:
{ return 0; }if ( commandLine.hasOption( CLIManager.VERSION ) )
{
showVersion();
if ( // *** Add second condition )
}