mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-21 19:35:08 +00:00
Fix version display (fixes #838)
This commit is contained in:
@@ -227,11 +227,11 @@ public class DaemonMavenCli implements DaemonCli {
|
|||||||
environment(cliRequest.workingDirectory, clientEnv);
|
environment(cliRequest.workingDirectory, clientEnv);
|
||||||
cli(cliRequest);
|
cli(cliRequest);
|
||||||
properties(cliRequest);
|
properties(cliRequest);
|
||||||
help(cliRequest);
|
|
||||||
logging(cliRequest);
|
logging(cliRequest);
|
||||||
|
informativeCommands(cliRequest);
|
||||||
|
version(cliRequest);
|
||||||
container(cliRequest);
|
container(cliRequest);
|
||||||
configure(cliRequest, eventSpyDispatcher, configurationProcessors);
|
configure(cliRequest, eventSpyDispatcher, configurationProcessors);
|
||||||
version(cliRequest);
|
|
||||||
toolchains(cliRequest);
|
toolchains(cliRequest);
|
||||||
populateRequest(cliRequest);
|
populateRequest(cliRequest);
|
||||||
encryption(cliRequest);
|
encryption(cliRequest);
|
||||||
@@ -296,11 +296,20 @@ public class DaemonMavenCli implements DaemonCli {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void help(CliRequest cliRequest) throws Exception {
|
private void informativeCommands(CliRequest cliRequest) throws Exception {
|
||||||
if (cliRequest.commandLine.hasOption(CLIManager.HELP)) {
|
if (cliRequest.commandLine.hasOption(CLIManager.HELP)) {
|
||||||
buildEventListener.log(MvndHelpFormatter.displayHelp(newCLIManager()));
|
buildEventListener.log(MvndHelpFormatter.displayHelp(newCLIManager()));
|
||||||
throw new ExitException(0);
|
throw new ExitException(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cliRequest.commandLine.hasOption(CLIManager.VERSION)) {
|
||||||
|
if (cliRequest.commandLine.hasOption(CLIManager.QUIET)) {
|
||||||
|
buildEventListener.log(CLIReportingUtils.showVersionMinimal());
|
||||||
|
} else {
|
||||||
|
buildEventListener.log(CLIReportingUtils.showVersion());
|
||||||
|
}
|
||||||
|
throw new ExitException(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CLIManager newCLIManager() {
|
private CLIManager newCLIManager() {
|
||||||
@@ -416,11 +425,8 @@ public class DaemonMavenCli implements DaemonCli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void version(CliRequest cliRequest) throws ExitException {
|
private void version(CliRequest cliRequest) throws ExitException {
|
||||||
if (cliRequest.debug || cliRequest.commandLine.hasOption(CLIManager.VERSION)) {
|
if (cliRequest.debug || cliRequest.commandLine.hasOption(CLIManager.SHOW_VERSION)) {
|
||||||
buildEventListener.log(CLIReportingUtils.showVersion());
|
buildEventListener.log(CLIReportingUtils.showVersion());
|
||||||
if (cliRequest.commandLine.hasOption(CLIManager.VERSION)) {
|
|
||||||
throw new ExitException(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -216,11 +216,11 @@ public class DaemonMavenCli implements DaemonCli {
|
|||||||
environment(cliRequest.workingDirectory, clientEnv);
|
environment(cliRequest.workingDirectory, clientEnv);
|
||||||
cli(cliRequest);
|
cli(cliRequest);
|
||||||
properties(cliRequest);
|
properties(cliRequest);
|
||||||
help(cliRequest);
|
|
||||||
logging(cliRequest);
|
logging(cliRequest);
|
||||||
|
informativeCommands(cliRequest);
|
||||||
|
version(cliRequest);
|
||||||
container(cliRequest);
|
container(cliRequest);
|
||||||
configure(cliRequest, eventSpyDispatcher, configurationProcessors);
|
configure(cliRequest, eventSpyDispatcher, configurationProcessors);
|
||||||
version(cliRequest);
|
|
||||||
toolchains(cliRequest);
|
toolchains(cliRequest);
|
||||||
populateRequest(cliRequest);
|
populateRequest(cliRequest);
|
||||||
encryption(cliRequest);
|
encryption(cliRequest);
|
||||||
@@ -285,11 +285,20 @@ public class DaemonMavenCli implements DaemonCli {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void help(CliRequest cliRequest) throws Exception {
|
private void informativeCommands(CliRequest cliRequest) throws Exception {
|
||||||
if (cliRequest.commandLine.hasOption(CLIManager.HELP)) {
|
if (cliRequest.commandLine.hasOption(CLIManager.HELP)) {
|
||||||
buildEventListener.log(MvndHelpFormatter.displayHelp(newCLIManager()));
|
buildEventListener.log(MvndHelpFormatter.displayHelp(newCLIManager()));
|
||||||
throw new ExitException(0);
|
throw new ExitException(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cliRequest.commandLine.hasOption(CLIManager.VERSION)) {
|
||||||
|
if (cliRequest.commandLine.hasOption(CLIManager.QUIET)) {
|
||||||
|
buildEventListener.log(CLIReportingUtils.showVersionMinimal());
|
||||||
|
} else {
|
||||||
|
buildEventListener.log(CLIReportingUtils.showVersion());
|
||||||
|
}
|
||||||
|
throw new ExitException(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CLIManager newCLIManager() {
|
private CLIManager newCLIManager() {
|
||||||
@@ -400,11 +409,8 @@ public class DaemonMavenCli implements DaemonCli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void version(CliRequest cliRequest) throws ExitException {
|
private void version(CliRequest cliRequest) throws ExitException {
|
||||||
if (cliRequest.verbose || cliRequest.commandLine.hasOption(CLIManager.VERSION)) {
|
if (cliRequest.verbose || cliRequest.commandLine.hasOption(CLIManager.SHOW_VERSION)) {
|
||||||
buildEventListener.log(CLIReportingUtils.showVersion());
|
buildEventListener.log(CLIReportingUtils.showVersion());
|
||||||
if (cliRequest.commandLine.hasOption(CLIManager.VERSION)) {
|
|
||||||
throw new ExitException(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user