cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject [cxf-xjc-utils] branch master updated: [CXF-7517]detect jvm version and specify necessary jvm args for java9 so that users needn't specify it in plugin configuration
Date Tue, 24 Oct 2017 09:09:37 GMT
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-xjc-utils.git


The following commit(s) were added to refs/heads/master by this push:
     new ca2d94f  [CXF-7517]detect jvm version and specify necessary jvm args for java9 so
that users needn't specify it in plugin configuration
ca2d94f is described below

commit ca2d94fa2a5d192676cbceeff30af662117b0c80
Author: Freeman Fang <freeman.fang@gmail.com>
AuthorDate: Tue Oct 24 17:09:27 2017 +0800

    [CXF-7517]detect jvm version and specify necessary jvm args for java9 so that users needn't
specify it in plugin configuration
---
 .../apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
index 4a2ab37..4b1232d 100644
--- a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
+++ b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
@@ -153,6 +153,21 @@ public abstract class AbstractXSDToJavaMojo extends AbstractMojo {
         }
     }
     public void execute() throws MojoExecutionException {
+        if (System.getProperty("java.version").startsWith("9")) {
+            fork = true;
+            additionalJvmArgs = "--add-modules java.activation,java.xml.bind,java.xml.ws
" 
+                    + "--add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.runtime=ALL-UNNAMED
"
+                    + "--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED "
+                    + "--add-exports=java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED
"
+                    + "--add-exports=java.xml.bind/com.sun.xml.internal.bind.marshaller=ALL-UNNAMED
"
+                    + "--add-opens java.xml.ws/javax.xml.ws.wsaddressing=ALL-UNNAMED "
+                    + "--add-opens java.base/java.security=ALL-UNNAMED "
+                    + "--add-opens java.base/java.net=ALL-UNNAMED "
+                    + "--add-opens java.base/java.lang=ALL-UNNAMED "
+                    + "--add-opens java.base/java.util=ALL-UNNAMED "
+                    + "--add-opens java.base/java.util.concurrent=ALL-UNNAMED " 
+                    + (additionalJvmArgs == null ? "" : additionalJvmArgs); 
+        }
         String outputDir = getOutputDir();
         
         File outputDirFile = new File(outputDir);

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <commits@cxf.apache.org>'].

Mime
View raw message