cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5986] Correctly passing a defaultOption
Date Tue, 09 Sep 2014 20:40:10 GMT
Repository: cxf
Updated Branches:
  refs/heads/master e2bf1f63b -> 6bd77abd1


[CXF-5986] Correctly passing a defaultOption


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6bd77abd
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6bd77abd
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6bd77abd

Branch: refs/heads/master
Commit: 6bd77abd1898304ee16153526491e051c468e6b8
Parents: e2bf1f6
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Sep 9 21:39:23 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Sep 9 21:39:23 2014 +0100

----------------------------------------------------------------------
 .../apache/cxf/maven_plugin/wadlto/OptionLoader.java  | 14 +++++++++++---
 .../apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java |  7 +++++--
 2 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6bd77abd/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/OptionLoader.java
----------------------------------------------------------------------
diff --git a/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/OptionLoader.java
b/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/OptionLoader.java
index 97e5e33..c94e7af 100644
--- a/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/OptionLoader.java
+++ b/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/OptionLoader.java
@@ -85,8 +85,10 @@ public final class OptionLoader {
      * @return list of one WadlOption object for each wadl found
      * @throws MojoExecutionException
      */
-    public static List<WadlOption> loadWadlOptionsFromFile(File wadlBasedir, String
includes[],
-                                                            String excludes[], Option defaultOptions,
+    public static List<WadlOption> loadWadlOptionsFromFile(File wadlBasedir, 
+                                                           String includes[],
+                                                            String excludes[], 
+                                                            Option defaultOptions,
                                                             File defaultOutputDir)
         throws MojoExecutionException {
 
@@ -145,7 +147,8 @@ public final class OptionLoader {
     }
 
 
-    protected static WadlOption generateWadlOptionFromFile(final File wadl, final Option
defaultOptions,
+    protected static WadlOption generateWadlOptionFromFile(final File wadl, 
+                                                           final Option defaultOptions,
                                                            File defaultOutputDir)
         throws MojoExecutionException {
 
@@ -163,6 +166,11 @@ public final class OptionLoader {
         }
 
         final WadlOption wadlOption = new WadlOption();
+        if (defaultOptions != null) {
+            wadlOption.merge(defaultOptions);
+        }
+        
+        
         final String wadlName = wadlFileName.substring(0, idx);
 
         final String[] options = readOptionsFromFile(wadl.getParentFile(), wadlName);

http://git-wip-us.apache.org/repos/asf/cxf/blob/6bd77abd/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
b/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
index eca7157..071135c 100644
--- a/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
+++ b/maven-plugins/wadl2java-plugin/src/main/java/org/apache/cxf/maven_plugin/wadlto/WADL2JavaMojo.java
@@ -127,7 +127,6 @@ public class WADL2JavaMojo extends AbstractCodeGeneratorMojo {
     private List<WadlOption> createWadlOptionsFromScansAndExplicitWadlOptions(File
classesDir) 
         throws MojoExecutionException {
         List<WadlOption> effectiveOptions = new ArrayList<WadlOption>();
-        
         mergeOptions(effectiveOptions);
         downloadRemoteDocs(effectiveOptions);
         if (effectiveOptions.isEmpty()) {
@@ -138,7 +137,11 @@ public class WADL2JavaMojo extends AbstractCodeGeneratorMojo {
             }
             File defaultRoot = wadlRoot != null && wadlRoot.exists() ? wadlRoot :
testWadlRoot;
             effectiveOptions.addAll(
-                OptionLoader.loadWadlOptionsFromFile(defaultRoot, includes, excludes, null,
classesDir));
+                OptionLoader.loadWadlOptionsFromFile(defaultRoot, 
+                                                     includes, 
+                                                     excludes, 
+                                                     defaultOptions, 
+                                                     classesDir));
         }
         return effectiveOptions;
     }


Mime
View raw message