karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject [karaf] branch jdk12 updated: [KARAF-6203]ensure karaf can build and run with JDK12-fix InstanceTest
Date Wed, 27 Mar 2019 03:24:01 GMT
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch jdk12
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/jdk12 by this push:
     new 5842db7  [KARAF-6203]ensure karaf can build and run with JDK12-fix InstanceTest
5842db7 is described below

commit 5842db73d6e40129cce16c25abcb244564edb2ce
Author: Freeman Fang <freeman.fang@gmail.com>
AuthorDate: Wed Mar 27 11:23:44 2019 +0800

    [KARAF-6203]ensure karaf can build and run with JDK12-fix InstanceTest
---
 .../instance/core/internal/InstanceServiceImpl.java   | 19 ++++++++++++++-----
 .../karaf/instance/resources/etc/config.properties    |  6 ++++++
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
b/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
index 3ac2df3..8b23768 100644
--- a/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
+++ b/instance/src/main/java/org/apache/karaf/instance/core/internal/InstanceServiceImpl.java
@@ -513,7 +513,16 @@ public class InstanceServiceImpl implements InstanceService {
 
         String jdkOpts;
         if (!System.getProperty("java.version").startsWith("1.")) {
-            jdkOpts = " --add-opens java.base/java.security=ALL-UNNAMED" +
+            File jdk9LibDir = new File(libDir, "jdk9plus");
+            File endorsedLibDir = new File(libDir, "endorsed");
+            StringBuilder jdk9plusClasspath = classpathFromLibDir(jdk9LibDir);
+            classpath.append(System.getProperty("path.separator"));
+            classpath.append(jdk9plusClasspath);
+            jdkOpts = " --add-reads=java.xml=java.logging" +
+                      " --add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"
+
+                      " --patch-module java.base=" + endorsedLibDir.getAbsolutePath() + "/org.apache.karaf.specs.locator-4.3.0-SNAPSHOT.jar"
+
+                      " --patch-module java.xml=" + endorsedLibDir.getAbsolutePath() + "/org.apache.karaf.specs.java.xml-4.3.0-SNAPSHOT.jar"
+
+                      " --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" +
@@ -522,10 +531,10 @@ public class InstanceServiceImpl implements InstanceService {
                       " --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED" +
                       " --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED" +
                       " --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED" +
-                      " --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=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED" +
-                      " --add-modules java.xml.ws.annotation,java.corba,java.transaction,java.xml.bind,java.xml.ws";
+                      " --add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED" +
+                      " --add-exports=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED" +
+                      " --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED";
+                      
         } else {
             jdkOpts = " -Djava.endorsed.dirs=\"" + new File(new File(new File(System.getProperty("java.home"),
"jre"), "lib"), "endorsed") + System.getProperty("path.separator") + new File(new File(System.getProperty("java.home"),
"lib"), "endorsed") + System.getProperty("path.separator") + new File(libDir, "endorsed").getCanonicalPath()
+ "\""
                     + " -Djava.ext.dirs=\"" + new File(new File(new File(System.getProperty("java.home"),
"jre"), "lib"), "ext") + System.getProperty("path.separator") + new File(new File(System.getProperty("java.home"),
"lib"), "ext") + System.getProperty("path.separator") + new File(libDir, "ext").getCanonicalPath()
+ "\"";
diff --git a/instance/src/main/resources/org/apache/karaf/instance/resources/etc/config.properties
b/instance/src/main/resources/org/apache/karaf/instance/resources/etc/config.properties
index 0495f45..ff926f6 100644
--- a/instance/src/main/resources/org/apache/karaf/instance/resources/etc/config.properties
+++ b/instance/src/main/resources/org/apache/karaf/instance/resources/etc/config.properties
@@ -127,6 +127,12 @@ equinox-capabilities= \
  osgi.service;objectClass:List<String>=org.eclipse.osgi.service.security.TrustEngine;osgi.signedcontent.trust.engine=org.eclipse.osgi,
\
  osgi.service;objectClass:List<String>=org.eclipse.osgi.service.urlconversion.URLConverter;protocol:List<String>="bundleentry,bundleresource"
 
+eecap-12= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,12.0",
\
+ osgi.ee; osgi.ee="JRE"; version:List<Version>="1.0,1.1", \
+ osgi.ee; osgi.ee="JavaSE/compact1"; version:List<Version>="1.8,9.0,10.0,11.0,12.0",
\
+ osgi.ee; osgi.ee="JavaSE/compact2"; version:List<Version>="1.8,9.0,10.0,11.0,12.0",
\
+ osgi.ee; osgi.ee="JavaSE/compact3"; version:List<Version>="1.8,9.0,10.0,11.0,12.0"
 eecap-11= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
  osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0",
\
  osgi.ee; osgi.ee="JRE"; version:List<Version>="1.0,1.1", \


Mime
View raw message