This is an automated email from the ASF dual-hosted git repository.

sergeyb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new bad68af  Updating Java2WADLMojo to try to load the custom 
WADLgenerator if requested
bad68af is described below

commit bad68afd7ffc078b010e98dba84ec49b18258ae3
Author: Sergey Beryozkin <[email protected]>
AuthorDate: Thu Oct 19 13:12:13 2017 +0100

    Updating Java2WADLMojo to try to load the custom WADLgenerator if requested
---
 .../cxf/maven_plugin/javatowadl/Java2WADLMojo.java    | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git 
a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
 
b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
index 8dae3b8..dacd326 100644
--- 
a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
+++ 
b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
@@ -78,6 +78,11 @@ public class Java2WADLMojo extends AbstractMojo {
      * @parameter
      */
     private String docProvider;
+    
+    /**
+     * @parameter
+     */
+    private String customWadlGenerator;
 
 
     /**
@@ -231,7 +236,19 @@ public class Java2WADLMojo extends AbstractMojo {
         System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", 
"true");
         List<Class<?>> resourceClasses = loadResourceClasses();
         initClassResourceInfoList(resourceClasses);
-        WadlGenerator wadlGenerator = new WadlGenerator(getBus());
+        WadlGenerator wadlGenerator = null;
+        if (customWadlGenerator != null) {
+            try {
+                wadlGenerator = 
(WadlGenerator)getClassLoader().loadClass(customWadlGenerator).
+                    getConstructor(new Class[] {Bus.class}).
+                    newInstance(new Object[] {getBus()});
+            } catch (Throwable e) {
+                getLog().debug("Custom WADLGenerator can not be created, using 
the default one");
+            }
+        }
+        if (wadlGenerator == null) {
+            wadlGenerator = new WadlGenerator(getBus());
+        }
         DocumentationProvider documentationProvider = null;
         if (docProvider != null) {
             try {

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to