mirror of https://github.com/apache/maven.git
[MNG-7181] Make --version support -q
This commit is contained in:
parent
a70828c737
commit
1fc605dd69
|
@ -75,6 +75,13 @@ public final class CLIReportingUtils
|
||||||
return version.toString();
|
return version.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String showVersionMinimal()
|
||||||
|
{
|
||||||
|
Properties properties = getBuildProperties();
|
||||||
|
String version = reduce( properties.getProperty( BUILD_VERSION_PROPERTY ) );
|
||||||
|
return ( version != null ? version : "<version unknown>" );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a human readable string containing the Maven version, buildnumber, and time of build
|
* Create a human readable string containing the Maven version, buildnumber, and time of build
|
||||||
*
|
*
|
||||||
|
|
|
@ -439,7 +439,14 @@ public class MavenCli
|
||||||
|
|
||||||
if ( cliRequest.commandLine.hasOption( CLIManager.VERSION ) )
|
if ( cliRequest.commandLine.hasOption( CLIManager.VERSION ) )
|
||||||
{
|
{
|
||||||
System.out.println( CLIReportingUtils.showVersion() );
|
if ( cliRequest.commandLine.hasOption( CLIManager.QUIET ) )
|
||||||
|
{
|
||||||
|
System.out.println( CLIReportingUtils.showVersionMinimal() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
System.out.println( CLIReportingUtils.showVersion() );
|
||||||
|
}
|
||||||
throw new ExitException( 0 );
|
throw new ExitException( 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue