You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2008/09/12 03:39:56 UTC

svn commit: r694580 - in /cxf/branches/2.0.x-fixes: ./ maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java

Author: dkulp
Date: Thu Sep 11 18:39:55 2008
New Revision: 694580

URL: http://svn.apache.org/viewvc?rev=694580&view=rev
Log:
Merged revisions 694472 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.1.x-fixes

................
  r694472 | dkulp | 2008-09-11 16:51:54 -0400 (Thu, 11 Sep 2008) | 9 lines
  
  Merged revisions 694417 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r694417 | dkulp | 2008-09-11 14:50:36 -0400 (Thu, 11 Sep 2008) | 2 lines
    
    [CXF-1794] Fix problem with wsdlOptions not being applied correctly
  ........
................

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 11 18:39:55 2008
@@ -1,3 +1,3 @@
-/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469
-/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263
+/cxf/branches/2.1.x-fixes:673548,674485,674547,674551,674562,674601,674649,674764,674887,675644,675653,677048,677385,678004,678009,678559,678629,678808,678852,678891,678893,679248,679597,680435,681060,681165,681813,681816,682902,682951,683089,683290,683318,684099,684790-684793,684842,684862,684895-684918,685205,685253,686237,686283,686299,686333-686364,686765,686827,687097,687464-687465,689109,689112,689122,691316,691357,691491,691711,691715,691745,692162-692163,692468,692500,694466-694469,694472
+/cxf/trunk:651669-686342,686344-686363,686764,686820,687096,687387,687463,688086,688102,688735,691271,691355,691488,691602,691706,691728,692116,692157,692466,692499,693653,693819,694179,694263,694417
 /incubator/cxf/trunk:434594-651668

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Sep 11 18:39:55 2008
@@ -1 +1 @@
-/cxf/branches/2.1.x-fixes:1-686313,686315-686332,686334-686346,686348-686828,687097,687464-687465,689109,689112,689122,690841,691316,691357,691491,691711,691715,691745,692162-692163,692344,692468,692500,694466-694469
+/cxf/branches/2.1.x-fixes:1-686313,686315-686332,686334-686346,686348-686828,687097,687464-687465,689109,689112,689122,690841,691316,691357,691491,691711,691715,691745,692162-692163,692344,692468,692500,694466-694469,694472

Modified: cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java?rev=694580&r1=694579&r2=694580&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java (original)
+++ cxf/branches/2.0.x-fixes/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/WSDL2JavaMojo.java Thu Sep 11 18:39:55 2008
@@ -132,6 +132,47 @@
         return options;
     }
     
+    private void mergeOptions(List<WsdlOption> options) {
+        File outputDirFile = testSourceRoot == null ? sourceRoot : testSourceRoot;
+        for (WsdlOption o : wsdlOptions) {
+            if (o.getOutputDir() == null) {
+                o.setOutputDir(outputDirFile);
+            }
+            
+            File file = new File(o.getWsdl());
+            if (!file.exists()) {
+                file = new File(project.getBasedir(), o.getWsdl());
+            }
+            if (file.exists()) {
+                file = file.getAbsoluteFile();
+                for (WsdlOption o2 : options) {
+                    File file2 = null;
+                    try {
+                        URI uri = new URI(o2.getWsdl());
+                        if (uri.isAbsolute()) {
+                            file2 = new File(uri);
+                        }
+                    } catch (Exception e) {
+                        //ignore
+                    }
+                    if (file2 == null || !file2.exists()) {
+                        file2 = new File(o2.getWsdl());
+                    }
+                    if (file2 == null || !file2.exists()) {
+                        file2 = new File(project.getBasedir(), o2.getWsdl());
+                    }
+                    if (file2.exists() 
+                        && file2.getAbsoluteFile().equals(file)) {
+                        o.getExtraargs().addAll(0, o2.getExtraargs());
+                        options.remove(o2);
+                        break;
+                    }
+                }
+            }
+            options.add(0, o);
+        }        
+    }
+    
     public void execute() throws MojoExecutionException {
         if (includes == null) {
             includes = new String[] {"*.wsdl"};
@@ -150,26 +191,7 @@
         }
 
         if (wsdlOptions != null) {
-            File outputDirFile = testSourceRoot == null ? sourceRoot : testSourceRoot;
-            for (WsdlOption o : wsdlOptions) {
-                if (o.getOutputDir() == null) {
-                    o.setOutputDir(outputDirFile);
-                }
-                
-                File file = new File(project.getBasedir(), o.getWsdl());                
-                if (file.exists()) {
-                    for (WsdlOption o2 : options) {
-                        File file2 = new File(o2.getWsdl());
-                        if (file2.exists() 
-                            && file2.equals(file)) {
-                            o.getExtraargs().addAll(0, o2.getExtraargs());
-                            options.remove(o2);
-                            break;
-                        }
-                    }
-                }
-                options.add(o);
-            }
+            mergeOptions(options);
         }
         wsdlOptions = options.toArray(new WsdlOption[options.size()]);