From 538de4d1924ef982df12d32da394e375561a6e19 Mon Sep 17 00:00:00 2001 From: Karl Heinz Marbaise Date: Fri, 10 Apr 2020 14:21:09 +0200 Subject: [PATCH] [MNG-6888] Remove deprecated command line options This closes #418 --- .../java/org/apache/maven/cli/CLIManager.java | 6 ------ .../main/java/org/apache/maven/cli/MavenCli.java | 15 --------------- 2 files changed, 21 deletions(-) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java index 65f609c5be..d1941803a1 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java @@ -149,12 +149,6 @@ public class CLIManager options.addOption( Option.builder( LEGACY_LOCAL_REPOSITORY ).longOpt( "legacy-local-repository" ).desc( "Use Maven 2 Legacy Local Repository behaviour, ie no use of _remote.repositories. Can also be activated by using -Dmaven.legacyLocalRepo=true" ).build() ); options.addOption( Option.builder( BUILDER ).longOpt( "builder" ).hasArg().desc( "The id of the build strategy to use" ).build() ); options.addOption( Option.builder( NO_TRANSFER_PROGRESS ).longOpt( "no-transfer-progress" ).desc( "Do not display transfer progress when downloading or uploading" ).build() ); - - // Adding this back in for compatibility with the verifier that hard codes this option. - options.addOption( Option.builder( "npr" ).longOpt( "no-plugin-registry" ).desc( "Ineffective, only kept for backward compatibility" ).build() ); - options.addOption( Option.builder( "cpu" ).longOpt( "check-plugin-updates" ).desc( "Ineffective, only kept for backward compatibility" ).build() ); - options.addOption( Option.builder( "up" ).longOpt( "update-plugins" ).desc( "Ineffective, only kept for backward compatibility" ).build() ); - options.addOption( Option.builder( "npu" ).longOpt( "no-plugin-updates" ).desc( "Ineffective, only kept for backward compatibility" ).build() ); } public CommandLine parse( String[] args ) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 7b3728ed0b..055e89e48a 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -103,7 +103,6 @@ import java.io.InputStream; import java.io.PrintStream; import java.nio.file.Files; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashMap; @@ -149,8 +148,6 @@ public class MavenCli public static final String STYLE_COLOR_PROPERTY = "style.color"; - private static final String[] DEPRECATED_OPTIONS = { "up", "npu", "cpu", "npr" }; - private ClassWorld classWorld; private LoggerManager plexusLoggerManager; @@ -1351,8 +1348,6 @@ public class MavenCli request.setShowErrors( cliRequest.showErrors ); // default: false File baseDirectory = new File( workingDirectory, "" ).getAbsoluteFile(); - handleDeprecatedOptions( commandLine ); - disableOnPresentOption( commandLine, CLIManager.BATCH_MODE, request::setInteractiveMode ); enableOnPresentOption( commandLine, CLIManager.SUPRESS_SNAPSHOT_UPDATES, request::setNoSnapshotUpdates ); request.setGoals( commandLine.getArgList() ); @@ -1562,16 +1557,6 @@ public class MavenCli } } - private void handleDeprecatedOptions( final CommandLine commandLine ) - { - Arrays.stream( DEPRECATED_OPTIONS ) - .filter( commandLine::hasOption ) - .forEach( deprecatedOption -> slf4jLogger.warn( - "Command line option -{} is deprecated and will be removed in future Maven versions.", - deprecatedOption ) - ); - } - private String determineReactorFailureBehaviour( final CommandLine commandLine ) { if ( commandLine.hasOption( CLIManager.FAIL_FAST ) )