cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1226953 - in /cxf/trunk: maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/ testutils/
Date Tue, 03 Jan 2012 21:24:25 GMT
Author: dkulp
Date: Tue Jan  3 21:24:25 2012
New Revision: 1226953

URL: http://svn.apache.org/viewvc?rev=1226953&view=rev
Log:
[CXF-4005, CXF-4004] Fix issues where extraargs could be double merged
and causing duplicate arguments.

Modified:
    cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
    cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java
    cxf/trunk/testutils/pom.xml

Modified: cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java?rev=1226953&r1=1226952&r2=1226953&view=diff
==============================================================================
--- cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
(original)
+++ cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WSDL2JavaMojo.java
Tue Jan  3 21:24:25 2012
@@ -247,23 +247,22 @@ public class WSDL2JavaMojo extends Abstr
         
         List<GenericWsdlOption> temp;
         if (wsdlRoot != null && wsdlRoot.exists() && !disableDirectoryScan)
{
-            temp = WsdlOptionLoader.loadWsdlOptionsFromFiles(wsdlRoot, includes, excludes,
defaultOptions,
+            temp = WsdlOptionLoader.loadWsdlOptionsFromFiles(wsdlRoot, includes, excludes,
                                                              getGeneratedSourceRoot());
             effectiveWsdlOptions.addAll(temp);
         }
         if (testWsdlRoot != null && testWsdlRoot.exists() && !disableDirectoryScan)
{
             temp = WsdlOptionLoader.loadWsdlOptionsFromFiles(testWsdlRoot, includes, excludes,
-                                                             defaultOptions, getGeneratedTestRoot());
+                                                             getGeneratedTestRoot());
             effectiveWsdlOptions.addAll(temp);
         }
         if (!disableDependencyScan) {
             temp = WsdlOptionLoader.loadWsdlOptionsFromDependencies(project, 
-                                                                    defaultOptions, 
                                                                     getGeneratedSourceRoot());
             effectiveWsdlOptions.addAll(temp);
         }
-        downloadRemoteWsdls(effectiveWsdlOptions);
         mergeOptions(effectiveWsdlOptions);
+        downloadRemoteWsdls(effectiveWsdlOptions);
         return effectiveWsdlOptions;
     }
 

Modified: cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java?rev=1226953&r1=1226952&r2=1226953&view=diff
==============================================================================
--- cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java
(original)
+++ cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java
Tue Jan  3 21:24:25 2012
@@ -43,16 +43,12 @@ public final class WsdlOptionLoader {
     
     public static List<GenericWsdlOption> 
     loadWsdlOptionsFromDependencies(MavenProject project, 
-                                    Option defaultOptions, 
                                     File outputDir) {
         List<GenericWsdlOption> options = new ArrayList<GenericWsdlOption>();
         Set<Artifact> dependencies = CastUtils.cast(project.getDependencyArtifacts());
         for (Artifact artifact : dependencies) {
             WsdlOption option = generateWsdlOptionFromArtifact(artifact, outputDir);
             if (option != null) {
-                if (defaultOptions != null) {
-                    option.merge(defaultOptions);
-                }
                 options.add(option);
             }
         }
@@ -82,7 +78,7 @@ public final class WsdlOptionLoader {
      */
     public static List<GenericWsdlOption> 
     loadWsdlOptionsFromFiles(File wsdlBasedir, String includes[],
-                                 String excludes[], Option defaultOptions,
+                                 String excludes[],
                                  File defaultOutputDir)
         throws MojoExecutionException {
 
@@ -98,7 +94,7 @@ public final class WsdlOptionLoader {
         List<GenericWsdlOption> wsdlOptions 
             = new ArrayList<GenericWsdlOption>();
         for (File wsdl : wsdlFiles) {
-            WsdlOption wsdlOption = generateWsdlOptionFromFile(wsdl, defaultOptions, defaultOutputDir);
+            WsdlOption wsdlOption = generateWsdlOptionFromFile(wsdl, defaultOutputDir);
             if (wsdlOption != null) {
                 wsdlOptions.add(wsdlOption);
             }
@@ -129,7 +125,6 @@ public final class WsdlOptionLoader {
     }
 
     protected static WsdlOption generateWsdlOptionFromFile(final File wsdl, 
-                                                           final Option defaultOptions,
                                                            File defaultOutputDir)
         throws MojoExecutionException {
 
@@ -152,9 +147,6 @@ public final class WsdlOptionLoader {
         final String[] options = readOptionsFromFile(wsdl.getParentFile(), wsdlName);
         if (options.length > 0) {
             wsdlOption.getExtraargs().addAll(Arrays.asList(options));
-        } else if (defaultOptions != null) {
-            // no options specified use the defaults
-            defaultOptions.copyOptions(wsdlOption);
         }
 
         List<File> bindingFiles = FileUtils.getFiles(wsdl.getParentFile(), wsdlName
+ WSDL_BINDINGS);

Modified: cxf/trunk/testutils/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/pom.xml?rev=1226953&r1=1226952&r2=1226953&view=diff
==============================================================================
--- cxf/trunk/testutils/pom.xml (original)
+++ cxf/trunk/testutils/pom.xml Tue Jan  3 21:24:25 2012
@@ -160,11 +160,15 @@
                             <fork>${cxf.codegenplugin.forkmode}</fork>
                             <sourceRoot>target/generated/src/main/java</sourceRoot>
                             <wsdlRoot>src/main/resources/wsdl</wsdlRoot>
-			    <includes>
-			      <include>*.wsdl</include>
-			      <include>rt-javascript/*.wsdl</include>
-			    </includes>
-
+                            <includes>
+                                <include>*.wsdl</include>
+                                <include>rt-javascript/*.wsdl</include>
+                            </includes>
+                            <defaultOptions>
+                                <extraargs>
+                                    <extraarg>-verbose</extraarg>
+                                </extraargs>
+                            </defaultOptions>
                             <wsdlOptions>
                                 <wsdlOption>
                                     <wsdl>target/generated/src/main/resources/wsdl/type_test/type_test_xml.wsdl</wsdl>



Mime
View raw message