Patch jre.properties 10/100910/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 2 May 2022 11:37:49 +0000 (13:37 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 2 May 2022 12:07:41 +0000 (14:07 +0200)
All Karaf versions fail to export JDK9+-specific packages, such as
java.lang.module, java.net.http and similar. Fix this by patching
jre.properties.

JIRA: ODLPARENT-284
Change-Id: If2aa35a5d69b7d75783432bee8abbd095c59ebe5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7c92ac6bd47ca8870f70c076a2988d65d437c64d)

karaf/opendaylight-karaf-resources/pom.xml
karaf/opendaylight-karaf-resources/src/main/patches/karaf-jre-properties.patch [new file with mode: 0644]

index 5c2b48990657ec1dab81d9a272d0915675bbab9e..3cda64750c7c08c152a36f2602a5243769d811dd 100644 (file)
@@ -156,6 +156,12 @@ mvn\:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.
                       tofile="${project.build.directory}/classes/etc/users.properties"/>
                 <fixcrlf srcdir="${project.build.directory}/classes/bin"
                          includes="*.bat" eol="crlf"/>
+                <!-- KARAF-7431: Fix JDK9+ exported packages -->
+                <patch patchfile="${project.basedir}/src/main/patches/karaf-jre-properties.patch"
+                       originalfile="${project.build.directory}/assembly/etc/jre.properties"
+                       failonerror="true"/>
+                <copy file="${project.build.directory}/assembly/etc/jre.properties"
+                      tofile="${project.build.directory}/classes/etc/jre.properties"/>
               </target>
             </configuration>
           </execution>
diff --git a/karaf/opendaylight-karaf-resources/src/main/patches/karaf-jre-properties.patch b/karaf/opendaylight-karaf-resources/src/main/patches/karaf-jre-properties.patch
new file mode 100644 (file)
index 0000000..f620b71
--- /dev/null
@@ -0,0 +1,42 @@
+diff --git a/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties b/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties
+index 11be98a445..21fab6e869 100644
+--- a/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties
++++ b/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties
+@@ -643,6 +643,8 @@ jre-1.8= \
+
+ jre-9= \
+  ${jre-base}, \
++ java.lang.module, \
++ java.net.spi, \
+  javax.accessibility, \
+  javax.activity, \
+  javax.annotation;version="1.3", \
+@@ -730,6 +732,7 @@ jre-9= \
+  javax.xml.bind.attachment;version="2.3.0", \
+  javax.xml.bind.helpers;version="2.3.0", \
+  javax.xml.bind.util;version="2.3.0", \
++ javax.xml.catalog, \
+  javax.xml.crypto, \
+  javax.xml.crypto.dom, \
+  javax.xml.crypto.dsig, \
+@@ -806,10 +809,15 @@ jre-9= \
+  com.sun.security.sasl.util
+
+ jre-10 = ${jre-9}
+-jre-11 = ${jre-10}
+-jre-13 = ${jre-11}
+-jre-14 = ${jre-13}
++jre-11 = ${jre-10}, \
++  java.net.http
++jre-12 = ${jre-11}, \
++  java.lang.constant
++jre-13 = ${jre-12}
++jre-14 = ${jre-13}, \
++  java.lang.runtime
+ jre-15 = ${jre-14}
+ jre-16 = ${jre-15}
+-jre-17 = ${jre-16}
++jre-17 = ${jre-16}, \
++  java.util.random
+ jre-18 = ${jre-17}
+