cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/2] cxf git commit: [CXF-6976] Don't disable jar caches for tooling
Date Tue, 28 Mar 2017 01:08:38 GMT
[CXF-6976] Don't disable jar caches for tooling


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

Branch: refs/heads/3.0.x-fixes
Commit: e046287f3b553023919d57f6a076175826b01a00
Parents: ab38f64
Author: Daniel Kulp <dkulp@apache.org>
Authored: Mon Mar 27 17:26:39 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Mon Mar 27 21:08:33 2017 -0400

----------------------------------------------------------------------
 .../cxf/maven_plugin/AbstractCodegenMoho.java   | 30 +++++++++++---------
 .../cxf/tools/common/CommandInterfaceUtils.java |  1 +
 .../cxf/tools/common/toolspec/ToolRunner.java   |  8 ++++--
 .../org/apache/cxf/tools/java2js/JavaToJS.java  |  2 ++
 .../org/apache/cxf/tools/java2ws/JavaToWS.java  |  1 +
 .../org/apache/cxf/tools/wadlto/WADLToJava.java |  2 +-
 .../org/apache/cxf/tools/wsdlto/WSDLToJava.java |  3 +-
 7 files changed, 29 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e046287f/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
index 70fe528..d58b2ff 100644
--- a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
+++ b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
@@ -261,6 +261,8 @@ public abstract class AbstractCodegenMoho extends AbstractMojo {
     }
 
     public void execute() throws MojoExecutionException {
+        System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true");
+
         // add the generated source into compile source
         // do this step first to ensure the source folder will be added to the Eclipse classpath
         if (project != null && getGeneratedSourceRoot() != null) {
@@ -296,20 +298,20 @@ public abstract class AbstractCodegenMoho extends AbstractMojo {
         String originalProxyUser = SystemPropertyAction.getProperty(HTTP_PROXY_USER);
         String originalProxyPassword = SystemPropertyAction.getProperty(HTTP_PROXY_PASSWORD);
                 
-        configureProxyServerSettings();
-
-        List<GenericWsdlOption> effectiveWsdlOptions = createWsdlOptionsFromScansAndExplicitWsdlOptions();
-
-        if (effectiveWsdlOptions.size() == 0) {
-            getLog().info("Nothing to generate");
-            return;
-        }
-
-        ClassLoaderSwitcher classLoaderSwitcher = new ClassLoaderSwitcher(getLog());
-        boolean result = true;
-
         Bus bus = null;
+        ClassLoaderSwitcher classLoaderSwitcher = null;
         try {
+            configureProxyServerSettings();
+
+            List<GenericWsdlOption> effectiveWsdlOptions = createWsdlOptionsFromScansAndExplicitWsdlOptions();
+
+            if (effectiveWsdlOptions.size() == 0) {
+                getLog().info("Nothing to generate");
+                return;
+            }
+            classLoaderSwitcher = new ClassLoaderSwitcher(getLog());
+            boolean result = true;
+    
             Set<URI> cp = classLoaderSwitcher.switchClassLoader(project, useCompileClasspath,
classesDir);
 
             if ("once".equals(fork) || "true".equals(fork)) {
@@ -331,7 +333,9 @@ public abstract class AbstractCodegenMoho extends AbstractMojo {
             if (bus != null) {
                 bus.shutdown(true);
             }
-            classLoaderSwitcher.restoreClassLoader();
+            if (classLoaderSwitcher != null) {
+                classLoaderSwitcher.restoreClassLoader();
+            }
             restoreProxySetting(originalProxyHost, originalProxyPort, originalNonProxyHosts,
                                 originalProxyUser, originalProxyPassword);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/e046287f/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java
b/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java
index 8884b34..d970feb 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/CommandInterfaceUtils.java
@@ -37,6 +37,7 @@ public final class CommandInterfaceUtils {
 
     public static void commandCommonMain() {
         if (!testInProgress) {
+            System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true");
             // force commons-logging into j.u.l so we can
             // configure it.
             System.setProperty("org.apache.commons.logging.Log",

http://git-wip-us.apache.org/repos/asf/cxf/blob/e046287f/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java
b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java
index 883bf72..2550ab3 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolRunner.java
@@ -30,7 +30,7 @@ import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
 public final class ToolRunner {
-    private static final Logger LOG = LogUtils.getL7dLogger(ToolRunner.class);
+    
     private ToolRunner() {
         // utility class - never constructed
     }
@@ -74,6 +74,7 @@ public final class ToolRunner {
                                boolean exitOnFinish,
                                ToolContext context,
                                OutputStream os) throws Exception {
+        System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true");
 
         ToolContainer container = null;
 
@@ -88,8 +89,9 @@ public final class ToolRunner {
                                             new ToolSpec(toolspecStream, validate)
                                         });
         } catch (Exception ex) {
-            Message message = new Message("CLZ_CANNOT_BE_CONSTRUCTED", LOG, clz.getName());
-            LOG.log(Level.SEVERE, message.toString());
+            Logger log = LogUtils.getL7dLogger(ToolRunner.class);
+            Message message = new Message("CLZ_CANNOT_BE_CONSTRUCTED", log, clz.getName());
+            log.log(Level.SEVERE, message.toString());
             throw new ToolException(message, ex);
         }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/e046287f/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java
----------------------------------------------------------------------
diff --git a/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java b/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java
index 3123af0..b429c65 100644
--- a/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java
+++ b/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2js/JavaToJS.java
@@ -99,6 +99,8 @@ public class JavaToJS extends AbstractCXFToolContainer {
     }
 
     public static void main(String[] pargs) {
+        System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true");
+
         try {
             ToolRunner.runTool(JavaToJS.class,
                                JavaToJS.class.getResourceAsStream("java2js.xml"),

http://git-wip-us.apache.org/repos/asf/cxf/blob/e046287f/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java
----------------------------------------------------------------------
diff --git a/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java b/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java
index 588bf9c..888e28f 100644
--- a/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java
+++ b/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/JavaToWS.java
@@ -39,6 +39,7 @@ public class JavaToWS {
     }
 
     public static void main(String[] args) {
+        System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true");
         CommandInterfaceUtils.commandCommonMain();
         JavaToWS j2w = new JavaToWS(args);
         try {

http://git-wip-us.apache.org/repos/asf/cxf/blob/e046287f/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
----------------------------------------------------------------------
diff --git a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
index 8b88362..9a0e7f4 100644
--- a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
+++ b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/WADLToJava.java
@@ -91,7 +91,7 @@ public class WADLToJava {
 
     
     public static void main(String[] pargs) {
-
+        System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true");
         CommandInterfaceUtils.commandCommonMain();
         WADLToJava w2j = new WADLToJava(pargs);
         try {

http://git-wip-us.apache.org/repos/asf/cxf/blob/e046287f/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java b/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
index 7d528bb..984bd53 100644
--- a/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
+++ b/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
@@ -176,7 +176,8 @@ public class WSDLToJava {
     }
 
     public static void main(String[] pargs) {
-
+        System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true");
+        
         CommandInterfaceUtils.commandCommonMain();
         WSDLToJava w2j = new WSDLToJava(pargs);
         try {


Mime
View raw message