This is an automated email from the ASF dual-hosted git repository. khmarbaise pushed a commit to branch MNG-6888 in repository https://gitbox.apache.org/repos/asf/maven.git
commit 9f96b0a6d407d465a0015d541f69f006c92d464e Author: Karl Heinz Marbaise <khmarba...@apache.org> AuthorDate: Fri Apr 10 14:21:09 2020 +0200 [MNG-6888] - Remove deprecated command line options --- .../src/main/java/org/apache/maven/cli/CLIManager.java | 6 ------ .../src/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 873fc97..3f32737 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 fd650f0..7bd2746 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; @@ -1352,8 +1349,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() ); @@ -1563,16 +1558,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 ) )