[1/2] maven git commit: [MNG-6069] Fix handling of -emp and -ep optional argument

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[1/2] maven git commit: [MNG-6069] Fix handling of -emp and -ep optional argument

Stephen Connolly
Repository: maven
Updated Branches:
  refs/heads/MNG-6069 fe6d51884 -> 0cafb4c04


[MNG-6069] Fix handling of -emp and -ep optional argument


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/04e67fde
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/04e67fde
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/04e67fde

Branch: refs/heads/MNG-6069
Commit: 04e67fde93959379eddcd8d17a129bd13e8e159b
Parents: fe6d518
Author: Stephen Connolly <[hidden email]>
Authored: Mon Mar 20 15:01:03 2017 +0000
Committer: Stephen Connolly <[hidden email]>
Committed: Mon Mar 20 15:01:03 2017 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/maven/cli/CLIManager.java           | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/04e67fde/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java
----------------------------------------------------------------------
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 20376d9..774dd0d 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
@@ -135,8 +135,8 @@ public class CLIManager
         options.addOption( Option.builder( ALSO_MAKE_DEPENDENTS ).longOpt( "also-make-dependents" ).desc( "If project list is specified, also build projects that depend on projects on the list" ).build() );
         options.addOption( Option.builder( LOG_FILE ).longOpt( "log-file" ).hasArg().desc( "Log file where all build output will go" ).build() );
         options.addOption( Option.builder( SHOW_VERSION ).longOpt( "show-version" ).desc( "Display version information WITHOUT stopping build" ).build() );
-        options.addOption( Option.builder( ENCRYPT_MASTER_PASSWORD ).longOpt( "encrypt-master-password" ).optionalArg( true ).desc( "Encrypt master security password" ).build() );
-        options.addOption( Option.builder( ENCRYPT_PASSWORD ).longOpt( "encrypt-password" ).optionalArg( true ).desc( "Encrypt server password" ).build() );
+        options.addOption( Option.builder( ENCRYPT_MASTER_PASSWORD ).longOpt( "encrypt-master-password" ).numberOfArgs( 1 ).argName( "password" ).optionalArg( true ).desc( "Encrypt master security password" ).build() );
+        options.addOption( Option.builder( ENCRYPT_PASSWORD ).longOpt( "encrypt-password" ).numberOfArgs( 1 ).argName( "password" ).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() );

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[2/2] maven git commit: [MNG-6069] Have to treat -D as taking a single argument or else any property with = in the name or = in the value will be mangled

Stephen Connolly
[MNG-6069] Have to treat -D as taking a single argument or else any property with = in the name or = in the value will be mangled


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/0cafb4c0
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/0cafb4c0
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/0cafb4c0

Branch: refs/heads/MNG-6069
Commit: 0cafb4c042da840d038d327b634619c9f26b6728
Parents: 04e67fd
Author: Stephen Connolly <[hidden email]>
Authored: Mon Mar 20 15:09:38 2017 +0000
Committer: Stephen Connolly <[hidden email]>
Committed: Mon Mar 20 15:09:38 2017 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/maven/cli/CLIManager.java    |  2 +-
 .../src/main/java/org/apache/maven/cli/MavenCli.java      | 10 +---------
 2 files changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/0cafb4c0/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java
----------------------------------------------------------------------
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 774dd0d..a474895 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
@@ -109,7 +109,7 @@ public class CLIManager
         options = new Options();
         options.addOption( Option.builder( HELP ).longOpt( "help" ).desc( "Display help information" ).build() );
         options.addOption( Option.builder( ALTERNATE_POM_FILE ).longOpt( "file" ).hasArg().desc( "Force the use of an alternate POM file (or directory with pom.xml)" ).build() );
-        options.addOption( Option.builder( SET_SYSTEM_PROPERTY ).longOpt( "define" ).hasArgs().valueSeparator().desc( "Define a system property" ).build() );
+        options.addOption( Option.builder( SET_SYSTEM_PROPERTY ).longOpt( "define" ).hasArg().desc( "Define a system property" ).build() );
         options.addOption( Option.builder( OFFLINE ).longOpt( "offline" ).desc( "Work offline" ).build() );
         options.addOption( Option.builder( VERSION ).longOpt( "version" ).desc( "Display version information" ).build() );
         options.addOption( Option.builder( QUIET ).longOpt( "quiet" ).desc( "Quiet output - only show errors" ).build() );

http://git-wip-us.apache.org/repos/asf/maven/blob/0cafb4c0/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
----------------------------------------------------------------------
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 f9eb17e..694f694 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
@@ -1671,15 +1671,7 @@ public class MavenCli
         {
             if ( CLIManager.SET_SYSTEM_PROPERTY.equals( opt.getOpt() ) )
             {
-                String[] values = opt.getValues();
-                if ( values.length == 1 )
-                {
-                    setCliProperty( values[0], userProperties );
-                }
-                else
-                {
-                    setCliProperty( values[0] + "=" + values[1], userProperties );
-                }
+                setCliProperty( opt.getValue(), userProperties );
             }
         }
 

Loading...