You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2020/04/10 12:27:55 UTC

[maven] branch MNG-6889 created (now 30b3464)

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a change to branch MNG-6889
in repository https://gitbox.apache.org/repos/asf/maven.git.


      at 30b3464  [MNG-6889] - Mark command line option --legacy-local-repository as deprecated

This branch includes the following new commits:

     new 30b3464  [MNG-6889] - Mark command line option --legacy-local-repository as deprecated

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven] 01/01: [MNG-6889] - Mark command line option --legacy-local-repository as deprecated

Posted by kh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch MNG-6889
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 30b34640bd05f78174d2f3f3a35b8438aeda0ca8
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Fri Apr 10 14:27:30 2020 +0200

    [MNG-6889] - Mark command line option --legacy-local-repository as deprecated
---
 .../src/main/java/org/apache/maven/cli/CLIManager.java      | 11 +++++------
 .../src/main/java/org/apache/maven/cli/MavenCli.java        | 13 +------------
 2 files changed, 6 insertions(+), 18 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 c9e002a..773e497 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
@@ -19,9 +19,6 @@ package org.apache.maven.cli;
  * under the License.
  */
 
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.GnuParser;
@@ -30,6 +27,9 @@ import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
 /**
  * @author Jason van Zyl
  */
@@ -99,8 +99,6 @@ public class CLIManager
 
     public static final String THREADS = "T";
 
-    public static final String LEGACY_LOCAL_REPOSITORY = "llr";
-
     public static final String BUILDER = "b";
 
     public static final String NO_TRANSFER_PROGRESS = "ntp";
@@ -143,10 +141,11 @@ public class CLIManager
         options.addOption( Option.builder( ENCRYPT_MASTER_PASSWORD ).longOpt( "encrypt-master-password" ).hasArg().optionalArg( true ).desc( "Encrypt master security password" ).build() );
         options.addOption( Option.builder( ENCRYPT_PASSWORD ).longOpt( "encrypt-password" ).hasArg().optionalArg( true ).desc( "Encrypt server password" ).build() );
         options.addOption( Option.builder( THREADS ).longOpt( "threads" ).hasArg().desc( "Thread count, for instance 2.0C where C is core multiplied" ).build() );
-        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() );
 
+        // Marked deprecated with MNG-6889
+        options.addOption( Option.builder( "llr" ).longOpt( "legacy-local-repository" ).desc( "Ineffective, only kept for backward compatibility" ).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() );
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 cbdf47f..d7da2a5 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
@@ -287,7 +287,6 @@ public class MavenCli
             toolchains( cliRequest );
             populateRequest( cliRequest );
             encryption( cliRequest );
-            repository( cliRequest );
             return execute( cliRequest );
         }
         catch ( ExitException e )
@@ -957,16 +956,6 @@ public class MavenCli
         }
     }
 
-    private void repository( CliRequest cliRequest )
-        throws Exception
-    {
-        if ( cliRequest.commandLine.hasOption( CLIManager.LEGACY_LOCAL_REPOSITORY ) || Boolean.getBoolean(
-            "maven.legacyLocalRepo" ) )
-        {
-            cliRequest.request.setUseLegacyLocalRepository( true );
-        }
-    }
-
     private int execute( CliRequest cliRequest )
         throws MavenExecutionRequestPopulationException
     {
@@ -1326,7 +1315,7 @@ public class MavenCli
         boolean quiet = cliRequest.quiet;
         boolean showErrors = cliRequest.showErrors;
 
-        String[] deprecatedOptions = { "up", "npu", "cpu", "npr" };
+        String[] deprecatedOptions = { "up", "npu", "cpu", "npr", "llr" };
         for ( String deprecatedOption : deprecatedOptions )
         {
             if ( commandLine.hasOption( deprecatedOption ) )