maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1763193 - /maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
Date Mon, 03 Oct 2016 18:51:32 GMT
Author: rfscholte
Date: Mon Oct  3 18:51:31 2016
New Revision: 1763193

URL: http://svn.apache.org/viewvc?rev=1763193&view=rev
Log:
[MCOMPILER-279] Passing multiple --add-exports args to the compilerArgs is not supported
Use compilerConfiguration.addCompilerCustomArgument() to pass arguments (allows duplicate
keys)

Modified:
    maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java

Modified: maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java?rev=1763193&r1=1763192&r2=1763193&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
(original)
+++ maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java
Mon Oct  3 18:51:31 2016
@@ -25,7 +25,6 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
-import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
@@ -812,7 +811,6 @@ public abstract class AbstractCompilerMo
         if ( ( effectiveCompilerArguments != null ) || ( effectiveCompilerArgument != null
)
                         || ( compilerArgs != null ) )
         {
-            LinkedHashMap<String, String> cplrArgsCopy = new LinkedHashMap<String,
String>();
             if ( effectiveCompilerArguments != null )
             {
                 for ( Map.Entry<String, String> me : effectiveCompilerArguments.entrySet()
)
@@ -826,26 +824,25 @@ public abstract class AbstractCompilerMo
 
                     if ( key.startsWith( "-A" ) && StringUtils.isNotEmpty( value
) )
                     {
-                        cplrArgsCopy.put( key + "=" + value, null );
+                        compilerConfiguration.addCompilerCustomArgument( key + "=" + value,
null );
                     }
                     else
                     {
-                        cplrArgsCopy.put( key, value );
+                        compilerConfiguration.addCompilerCustomArgument( key, value );
                     }
                 }
             }
             if ( !StringUtils.isEmpty( effectiveCompilerArgument ) )
             {
-                cplrArgsCopy.put( effectiveCompilerArgument, null );
+                compilerConfiguration.addCompilerCustomArgument( effectiveCompilerArgument,
null );
             }
             if ( compilerArgs != null )
             {
                 for ( String arg : compilerArgs )
                 {
-                    cplrArgsCopy.put( arg, null );
+                    compilerConfiguration.addCompilerCustomArgument( arg, null );
                 }
             }
-            compilerConfiguration.setCustomCompilerArguments( cplrArgsCopy );
         }
 
         // ----------------------------------------------------------------------



Mime
View raw message