You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2021/01/01 19:58:58 UTC
[maven] branch master updated: [MNG-6888] Remove deprecated command
line options
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push:
new 538de4d [MNG-6888] Remove deprecated command line options
538de4d is described below
commit 538de4d1924ef982df12d32da394e375561a6e19
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Fri Apr 10 14:21:09 2020 +0200
[MNG-6888] Remove deprecated command line options
This closes #418
---
.../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 65f609c..d194180 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 7b3728e..055e89e 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 ) )