cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [cxf] branch 3.1.x-fixes updated: Updating Java2WADLMojo to try to load the custom WADLgenerator if requested
Date Thu, 19 Oct 2017 12:15:51 GMT
This is an automated email from the ASF dual-hosted git repository.

sergeyb pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.1.x-fixes by this push:
     new 1c95b04  Updating Java2WADLMojo to try to load the custom WADLgenerator if requested
1c95b04 is described below

commit 1c95b04bb60f1cc3ea5b7953b1d5c02c4d6c7ff4
Author: Sergey Beryozkin <sberyozkin@gmail.com>
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  | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

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 786312e..ff6399c 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
@@ -79,7 +79,12 @@ public class Java2WADLMojo extends AbstractMojo {
      */
     private String docProvider;
     
-    
+    /**
+     * @parameter
+     */
+    private String customWadlGenerator;
+
+
     /**
      * Attach the generated wadl file to the list of files to be deployed
      * on install. This means the wadl file will be copied to the repository
@@ -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
['"commits@cxf.apache.org" <commits@cxf.apache.org>'].

Mime
View raw message