You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2017/11/23 10:53:47 UTC
[karaf] branch master updated: Partial revert of KARAF-5416 to keep
libraries on java 1.8 specific runtimes
This is an automated email from the ASF dual-hosted git repository.
gnodet 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 a0ee11e Partial revert of KARAF-5416 to keep libraries on java 1.8 specific runtimes
a0ee11e is described below
commit a0ee11e0a56924ec5a1beba4884b202fac62f7ea
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Nov 23 09:53:13 2017 +0100
Partial revert of KARAF-5416 to keep libraries on java 1.8 specific runtimes
This partially reverts commit 3f1f44b6521f058abea6f6df19ce03a4c353c991.
---
.../main/filtered-resources/resources/bin/karaf | 6 ++++++
.../filtered-resources/resources/bin/karaf.bat | 2 ++
.../src/main/resources/resources/lib/boot/README | 21 ++++++++++++++++++++
.../main/resources/resources/lib/endorsed/README | 23 ++++++++++++++++++++++
.../main/asciidoc/user-guide/os-integration.adoc | 4 ++++
.../org/apache/karaf/profile/assembly/Builder.java | 6 +++---
.../karaf/wrapper/internal/unix/karaf-wrapper.conf | 3 +++
.../wrapper/internal/windows/karaf-wrapper.conf | 3 +++
.../wrapper/internal/windows64/karaf-wrapper.conf | 3 +++
9 files changed, 68 insertions(+), 3 deletions(-)
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 a70a896..674b8d0 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf
@@ -155,8 +155,12 @@ run() {
if [ "x$CHECK_ROOT_INSTANCE_RUNNING" = "x" ]; then
CHECK_ROOT_INSTANCE_RUNNING=true
fi
+ JAVA_ENDORSED_DIRS="${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/endorsed:${KARAF_HOME}/lib/endorsed"
+ JAVA_EXT_DIRS="${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARAF_HOME}/lib/ext"
if ${cygwin}; then
JAVA_HOME=$(cygpath --path --windows "${JAVA_HOME}")
+ JAVA_ENDORSED_DIRS=$(cygpath --path --windows "${JAVA_ENDORSED_DIRS}")
+ JAVA_EXT_DIRS=$(cygpath --path --windows "${JAVA_EXT_DIRS}")
fi
convertPaths
cd "${KARAF_BASE}" || exit 2
@@ -290,6 +294,8 @@ run() {
${MAIN} "$@"
else
${KARAF_EXEC} "${JAVA}" ${JAVA_OPTS} \
+ -Djava.endorsed.dirs="${JAVA_ENDORSED_DIRS}" \
+ -Djava.ext.dirs="${JAVA_EXT_DIRS}" \
-Dkaraf.instances="${KARAF_HOME}/instances" \
-Dkaraf.home="${KARAF_HOME}" \
-Dkaraf.base="${KARAF_BASE}" \
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 0cb31c2..1f95c21 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
@@ -414,6 +414,8 @@ if "%KARAF_PROFILER%" == "" goto :RUN
) else (
"%JAVA%" %JAVA_OPTS% %OPTS% ^
-classpath "%CLASSPATH%" ^
+ -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" ^
+ -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext" ^
-Dkaraf.instances="%KARAF_HOME%\instances" ^
-Dkaraf.home="%KARAF_HOME%" ^
-Dkaraf.base="%KARAF_BASE%" ^
diff --git a/assemblies/features/base/src/main/resources/resources/lib/boot/README b/assemblies/features/base/src/main/resources/resources/lib/boot/README
new file mode 100644
index 0000000..b3a06ce
--- /dev/null
+++ b/assemblies/features/base/src/main/resources/resources/lib/boot/README
@@ -0,0 +1,21 @@
+################################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+Any jar in this folder will be added to the classpath by the JVM and will be
+available to the Main class. Custom locking libraries can be added here.
diff --git a/assemblies/features/base/src/main/resources/resources/lib/endorsed/README b/assemblies/features/base/src/main/resources/resources/lib/endorsed/README
new file mode 100644
index 0000000..0665a52
--- /dev/null
+++ b/assemblies/features/base/src/main/resources/resources/lib/endorsed/README
@@ -0,0 +1,23 @@
+################################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+This directory is the Java endorsed directory.
+Any jar in this folder will be used to override classes defined by the JVM.
+For more information, see:
+ http://download.oracle.com/javase/6/docs/technotes/guides/standards/
diff --git a/manual/src/main/asciidoc/user-guide/os-integration.adoc b/manual/src/main/asciidoc/user-guide/os-integration.adoc
index 70022e4..9af02e9 100644
--- a/manual/src/main/asciidoc/user-guide/os-integration.adoc
+++ b/manual/src/main/asciidoc/user-guide/os-integration.adoc
@@ -291,6 +291,10 @@ wrapper.java.additional.4=-Dkaraf.etc=%KARAF_ETC%
wrapper.java.additional.5=-Dcom.sun.management.jmxremote
wrapper.java.additional.6=-Dkaraf.startLocalConsole=false
wrapper.java.additional.7=-Dkaraf.startRemoteShell=true
+wrapper.java.additional.8=-Djava.io.tmpdir=%KARAF_DATA%/tmp
+# Uncomment if you need libraries on Java 8
+#wrapper.java.additional.9=-Djava.endorsed.dirs=%JAVA_HOME%/jre/lib/endorsed:%JAVA_HOME%/lib/endorsed:%KARAF_HOME%/lib/endorsed
+#wrapper.java.additional.10=-Djava.ext.dirs=%JAVA_HOME%/jre/lib/ext:%JAVA_HOME%/lib/ext:%KARAF_HOME%/lib/ext
# Uncomment to enable jmx
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616
diff --git a/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java b/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
index 01f9a4a..e69656b 100644
--- a/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
+++ b/profile/src/main/java/org/apache/karaf/profile/assembly/Builder.java
@@ -145,7 +145,7 @@ public class Builder {
List<String> blacklistedRepositories = new ArrayList<>();
BlacklistPolicy blacklistPolicy = BlacklistPolicy.Discard;
List<String> libraries = new ArrayList<>();
- String javase = "1.7";
+ String javase = "1.8";
KarafVersion karafVersion = KarafVersion.v4x;
String environment = null;
boolean useReferenceUrls;
@@ -715,8 +715,8 @@ public class Builder {
}
final String type = clause.getDirective(LIBRARY_CLAUSE_TYPE) != null
? clause.getDirective(LIBRARY_CLAUSE_TYPE) : Library.TYPE_DEFAULT;
- if (type == Library.TYPE_ENDORSED || type == Library.TYPE_EXTENSION) {
- LOGGER.warn("Ignoring library " + library + " which is of an unsupported type " + type + ".");
+ if (!javase.startsWith("1.") && (Library.TYPE_ENDORSED.equals(type) || Library.TYPE_EXTENSION.equals(type))) {
+ LOGGER.warn("Ignoring library " + library + " of type " + type + " which is only supported for Java 1.8.");
continue;
}
final String path;
diff --git a/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-wrapper.conf b/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-wrapper.conf
index 9bc2f9c..2b2f2a0 100644
--- a/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-wrapper.conf
+++ b/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/unix/karaf-wrapper.conf
@@ -45,6 +45,9 @@ wrapper.java.additional.5=-Dcom.sun.management.jmxremote
wrapper.java.additional.6=-Dkaraf.startLocalConsole=false
wrapper.java.additional.7=-Dkaraf.startRemoteShell=true
wrapper.java.additional.8=-Djava.io.tmpdir=%KARAF_DATA%/tmp
+# Uncomment if you need libraries on Java 8
+#wrapper.java.additional.9=-Djava.endorsed.dirs=%JAVA_HOME%/jre/lib/endorsed:%JAVA_HOME%/lib/endorsed:%KARAF_HOME%/lib/endorsed
+#wrapper.java.additional.10=-Djava.ext.dirs=%JAVA_HOME%/jre/lib/ext:%JAVA_HOME%/lib/ext:%KARAF_HOME%/lib/ext
# Uncomment to enable jmx
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616
diff --git a/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/windows/karaf-wrapper.conf b/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/windows/karaf-wrapper.conf
index 4765361..51a1877 100644
--- a/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/windows/karaf-wrapper.conf
+++ b/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/windows/karaf-wrapper.conf
@@ -45,6 +45,9 @@ wrapper.java.additional.5=-Dcom.sun.management.jmxremote
wrapper.java.additional.6=-Dkaraf.startLocalConsole=false
wrapper.java.additional.7=-Dkaraf.startRemoteShell=true
wrapper.java.additional.8=-Djava.io.tmpdir="%KARAF_DATA%/tmp"
+# Uncomment if you need libraries on Java 8
+#wrapper.java.additional.9=-Djava.endorsed.dirs="%JAVA_HOME%/jre/lib/endorsed;%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed"
+#wrapper.java.additional.10=-Djava.ext.dirs="%JAVA_HOME%/jre/lib/ext;%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
# Uncomment to enable jmx
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616
diff --git a/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/windows64/karaf-wrapper.conf b/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/windows64/karaf-wrapper.conf
index 4765361..51a1877 100644
--- a/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/windows64/karaf-wrapper.conf
+++ b/wrapper/src/main/resources/org/apache/karaf/wrapper/internal/windows64/karaf-wrapper.conf
@@ -45,6 +45,9 @@ wrapper.java.additional.5=-Dcom.sun.management.jmxremote
wrapper.java.additional.6=-Dkaraf.startLocalConsole=false
wrapper.java.additional.7=-Dkaraf.startRemoteShell=true
wrapper.java.additional.8=-Djava.io.tmpdir="%KARAF_DATA%/tmp"
+# Uncomment if you need libraries on Java 8
+#wrapper.java.additional.9=-Djava.endorsed.dirs="%JAVA_HOME%/jre/lib/endorsed;%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed"
+#wrapper.java.additional.10=-Djava.ext.dirs="%JAVA_HOME%/jre/lib/ext;%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
# Uncomment to enable jmx
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616
--
To stop receiving notification emails like this one, please contact
['"commits@karaf.apache.org" <co...@karaf.apache.org>'].