You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by ff...@apache.org on 2018/09/13 08:47:39 UTC
[karaf] branch master updated: [KARAF-5912]Don't need to use jaxb
jars for JDK8
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/karaf.git
The following commit(s) were added to refs/heads/master by this push:
new b15ce91 [KARAF-5912]Don't need to use jaxb jars for JDK8
b15ce91 is described below
commit b15ce91ec241a2347996ef6dde5937589e9d4555
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Thu Sep 13 16:47:06 2018 +0800
[KARAF-5912]Don't need to use jaxb jars for JDK8
---
assemblies/features/base/pom.xml | 8 ++++----
.../base/src/main/filtered-resources/resources/bin/karaf | 10 ++++++++++
.../src/main/filtered-resources/resources/bin/karaf.bat | 9 +++++++++
.../features/framework/src/main/feature/feature.xml | 1 -
.../karaf-soap-example-provider/pom.xml | 15 +++++++++++++++
.../java/org/apache/karaf/itests/KarafTestSupport.java | 6 +++++-
pom.xml | 2 ++
7 files changed, 45 insertions(+), 6 deletions(-)
diff --git a/assemblies/features/base/pom.xml b/assemblies/features/base/pom.xml
index 03bc6c7..f16431a 100644
--- a/assemblies/features/base/pom.xml
+++ b/assemblies/features/base/pom.xml
@@ -205,22 +205,22 @@
<artifactItem>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
- <outputDirectory>target/classes/resources/lib/boot</outputDirectory>
+ <outputDirectory>target/classes/resources/lib/jdk9plus</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
- <outputDirectory>target/classes/resources/lib/boot</outputDirectory>
+ <outputDirectory>target/classes/resources/lib/jdk9plus</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
- <outputDirectory>target/classes/resources/lib/boot</outputDirectory>
+ <outputDirectory>target/classes/resources/lib/jdk9plus</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
- <outputDirectory>target/classes/resources/lib/boot</outputDirectory>
+ <outputDirectory>target/classes/resources/lib/jdk9plus</outputDirectory>
</artifactItem>
<artifactItem>
diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
index d5245e6..878dde6 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
@@ -91,6 +91,16 @@ setupClassPath() {
CLASSPATH="${CLASSPATH}:${file}"
fi
done
+ if [ "${VERSION}" -gt "8" ] ; then
+ for file in "${KARAF_HOME}"/lib/jdk9plus/*.jar
+ do
+ if [ -z "${CLASSPATH}" ]; then
+ CLASSPATH="${file}"
+ else
+ CLASSPATH="${CLASSPATH}:${file}"
+ fi
+ done
+ fi
}
checkRootInstance() {
diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat
index d4d2c58..3e5ada9 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat
@@ -291,6 +291,12 @@ set suffix=%filename:~-4%
if %suffix% equ .jar set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\lib\boot\%filename%
goto :EOF
+: APPEND_TO_JDK9PLUS_CLASSPATH
+set filename=%~1
+set suffix=%filename:~-4%
+if %suffix% equ .jar set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\lib\jdk9plus\%filename%
+goto :EOF
+
:CLASSPATH_END
if "%CHECK_ROOT_INSTANCE_RUNNING%" == "" (
@@ -403,6 +409,9 @@ if "%KARAF_PROFILER%" == "" goto :RUN
rem If major version is greater than 1 (meaning Java 9 or 10), we don't use endorsed lib but module
rem If major version is 1 (meaning Java 1.6, 1.7, 1.8), we use endorsed lib
if %JAVA_VERSION% GTR 8 (
+ pushd "%KARAF_HOME%\lib\jdk9plus"
+ for %%G in (*.jar) do call:APPEND_TO_JDK9PLUS_CLASSPATH %%G
+ popd
"%JAVA%" %JAVA_OPTS% %OPTS% ^
--add-reads=java.xml=java.logging ^
--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED ^
diff --git a/assemblies/features/framework/src/main/feature/feature.xml b/assemblies/features/framework/src/main/feature/feature.xml
index 6df6283..6c58146 100644
--- a/assemblies/features/framework/src/main/feature/feature.xml
+++ b/assemblies/features/framework/src/main/feature/feature.xml
@@ -38,7 +38,6 @@
<!-- features service -->
<bundle start-level="15">mvn:org.apache.karaf.features/org.apache.karaf.features.core/${project.version}</bundle>
<bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/2.5.0</bundle>
- <bundle start-level="20">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/2.2.11_1</bundle>
<bundle dependency="true" start-level="30">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.5.0</bundle>
</feature>
diff --git a/examples/karaf-soap-example/karaf-soap-example-provider/pom.xml b/examples/karaf-soap-example/karaf-soap-example-provider/pom.xml
index fd1cd3e..40fdd3b 100644
--- a/examples/karaf-soap-example/karaf-soap-example-provider/pom.xml
+++ b/examples/karaf-soap-example/karaf-soap-example-provider/pom.xml
@@ -61,5 +61,20 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>java9-plus</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
+ <version>1.1.3</version>
+ </dependency>
+ </dependencies>
+ <activation>
+ <jdk>[9,)</jdk>
+ </activation>
+ </profile>
+ </profiles>
</project>
diff --git a/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java b/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java
index 48159e9..6beac50 100644
--- a/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java
+++ b/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java
@@ -62,6 +62,7 @@ import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil;
import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
+import org.ops4j.pax.exam.options.extra.EnvironmentOption;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -238,7 +239,10 @@ public class KarafTestSupport {
new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
- new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED")
+ new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
+ new VMOption("-classpath"),
+ new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
+
};
} else {
diff --git a/pom.xml b/pom.xml
index 0aa185f..45a5a0d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2373,6 +2373,8 @@
--add-opens java.naming/javax.naming.spi=ALL-UNNAMED
--add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED
</surefire.argLine>
+ <!--need pax.exam 4.13.0 to run with java11-->
+ <!--pax.exam.version>4.13.0-SNAPSHOT</pax.exam.version-->
</properties>
<activation>
<jdk>[9,)</jdk>