Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Karaf to 4.2.2 #834

Merged
merged 1 commit into from
Dec 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions distributions/openhab/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@
<type>xml</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.openhab.distro</groupId>
<artifactId>overrides</artifactId>
<version>${project.version}</version>
<classifier>features</classifier>
<type>xml</type>
<scope>runtime</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -120,7 +112,6 @@
<installedFeatures>
<feature>wrapper</feature>
<feature>wrap</feature>
<feature>openhab-overrides</feature>
</installedFeatures>
<startupFeatures>
<feature>eventadmin</feature>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ featuresRepositories = \
# Comma separated list of features to install at startup
#
featuresBoot = \
instance, \
package, \
log, \
ssh, \
framework, \
system, \
eventadmin, \
feature, \
shell, \
service, \
jaas, \
instance/${karaf.version}, \
package/${karaf.version}, \
log/${karaf.version}, \
ssh/${karaf.version}, \
framework/${karaf.version}, \
system/${karaf.version}, \
eventadmin/${karaf.version}, \
feature/${karaf.version}, \
shell/${karaf.version}, \
service/${karaf.version}, \
jaas/${karaf.version}, \
openhab-runtime-base, \
deployer, \
diagnostic, \
bundle, \
config, \
kar
deployer/${karaf.version}, \
diagnostic/${karaf.version}, \
bundle/${karaf.version}, \
config/${karaf.version}, \
kar/${karaf.version}

#
# Resource repositories (OBR) that the features resolver can use
Expand Down
19 changes: 15 additions & 4 deletions distributions/openhab/src/main/resources/bin/karaf
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -285,8 +295,9 @@ run() {
if [ "${VERSION}" -gt "8" ]; then
${KARAF_EXEC} "${JAVA}" ${JAVA_OPTS} \
--add-reads=java.xml=java.logging \
--patch-module java.base=lib/endorsed/org.apache.karaf.specs.locator-4.2.1.jar \
--patch-module java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-4.2.1.jar \
--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED \
--patch-module java.base=lib/endorsed/org.apache.karaf.specs.locator-4.2.2.jar \
--patch-module java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-4.2.2.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 \
Expand All @@ -303,7 +314,7 @@ run() {
-Dkaraf.base="${KARAF_BASE}" \
-Dkaraf.data="${KARAF_DATA}" \
-Dkaraf.etc="${KARAF_ETC}" \
-Dkaraf.logs="${OPENHAB_LOGDIR}" \
-Dkaraf.log="${OPENHAB_LOGDIR}" \
-Dkaraf.restart.jvm.supported=true \
-Djava.io.tmpdir="${KARAF_DATA}/tmp" \
-Djava.util.logging.config.file="${KARAF_BASE}/etc/java.util.logging.properties" \
Expand All @@ -321,7 +332,7 @@ run() {
-Dkaraf.base="${KARAF_BASE}" \
-Dkaraf.data="${KARAF_DATA}" \
-Dkaraf.etc="${KARAF_ETC}" \
-Dkaraf.logs="${OPENHAB_LOGDIR}" \
-Dkaraf.log="${OPENHAB_LOGDIR}" \
-Dkaraf.restart.jvm.supported=true \
-Djava.io.tmpdir="${KARAF_DATA}/tmp" \
-Djava.util.logging.config.file="${KARAF_BASE}/etc/java.util.logging.properties" \
Expand Down
18 changes: 14 additions & 4 deletions distributions/openhab/src/main/resources/bin/karaf.bat
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,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%" == "" (
Expand Down Expand Up @@ -405,10 +411,14 @@ 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 ^
--patch-module java.base=lib/endorsed/org.apache.karaf.specs.locator-4.2.1.jar ^
--patch-module java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-4.2.1.jar ^
--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED ^
--patch-module java.base=lib/endorsed/org.apache.karaf.specs.locator-4.2.2.jar ^
--patch-module java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-4.2.2.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 ^
Expand All @@ -425,7 +435,7 @@ if "%KARAF_PROFILER%" == "" goto :RUN
-Dkaraf.home="%KARAF_HOME%" ^
-Dkaraf.base="%KARAF_BASE%" ^
-Dkaraf.etc="%KARAF_ETC%" ^
-Dkaraf.logs="%OPENHAB_LOGDIR%" ^
-Dkaraf.log="%OPENHAB_LOGDIR%" ^
-Dkaraf.restart.jvm.supported=true ^
-Djava.io.tmpdir="%KARAF_DATA%\tmp" ^
-Dkaraf.data="%KARAF_DATA%" ^
Expand All @@ -440,7 +450,7 @@ if "%KARAF_PROFILER%" == "" goto :RUN
-Dkaraf.home="%KARAF_HOME%" ^
-Dkaraf.base="%KARAF_BASE%" ^
-Dkaraf.etc="%KARAF_ETC%" ^
-Dkaraf.logs="%OPENHAB_LOGDIR%" ^
-Dkaraf.log="%OPENHAB_LOGDIR%" ^
-Dkaraf.restart.jvm.supported=true ^
-Djava.io.tmpdir="%KARAF_DATA%\tmp" ^
-Dkaraf.data="%KARAF_DATA%" ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@
<Set name="idleTimeout">
<SystemProperty name="https.timeout" default="30000" />
</Set>
<Set name="soLingerTime">
<SystemProperty name="https.soLingerTime" default="-1" />
</Set>
</New>
</Arg>
</Call>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
karaf.bootstrap.log = ${karaf.logs}/openhab.log
karaf.bootstrap.log = ${karaf.log}/openhab.log
karaf.systemBundlesStartLevel = 50
karaf.framework = equinox
karaf.lock.dir=${karaf.data}/tmp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ log4j2.logger.lsp4j.level = OFF
log4j2.logger.karservice.name = org.apache.karaf.kar.internal.KarServiceImpl
log4j2.logger.karservice.level = ERROR

# Filters warnings about small thread pools.
# The thread pool is kept small intentionally for supporting resource constrained hardware.
log4j2.logger.threadpoolbudget.name = org.eclipse.jetty.util.thread.ThreadPoolBudget
log4j2.logger.threadpoolbudget.level = ERROR


# Appenders configuration

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/4.2.1-sp1
38 changes: 0 additions & 38 deletions features/overrides/pom.xml

This file was deleted.

6 changes: 0 additions & 6 deletions features/overrides/src/main/feature/feature.xml

This file was deleted.

1 change: 0 additions & 1 deletion features/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<module>distro-kar</module>
<module>distro-resources</module>
<module>addons</module>
<module>overrides</module>
</modules>

</project>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@

<jackson.version>1.9.13</jackson.version>

<karaf.version>4.2.1</karaf.version>
<jetty.version>9.4.11.v20180605</jetty.version>
<karaf.version>4.2.2</karaf.version>
<jetty.version>9.4.12.v20180830</jetty.version>

<!-- provided by Karaf -->
<dep.slf4j.api.groupId>org.slf4j</dep.slf4j.api.groupId>
Expand Down