Skip to content

Commit f4e653c

Browse files
authored
[2.7] JDK 21 build and test support (#1881)
* JDK 21 build and test support There are following changes due JDK21: -Tycho upgrade into 3.0.4 in core modules like jpa.jpql, core, jpa, sdo ... but 1.3.0 is activated instead default 3.0.4 by Maven profile with JDK 11 -maven.compiler.release remains at 8 -<comp.xlint>-Xlint:all,-this-escape</comp.xlint> in pom.xml in core.test.framework as compiler hangs there without any additional message -Antbuild script change to accept JDK range from 1.8 to 21 -Antbuild script sharedlib.xml change to use external JavaScript engine as this one was removed from higher versions of the JDKs -GitHub Action JDK 17 and 21-EA (Eclipse PR verification job remains with JDK 11) -JPA.JSE test fix on JDK 21 by Weld dependencies upgrade -MOXy test fix on JDK 21 by adding access to java.math module Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
1 parent c5c8da6 commit f4e653c

File tree

11 files changed

+47
-21
lines changed

11 files changed

+47
-21
lines changed

.github/workflows/ant.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ on:
1919
branches: [ '2.7' ]
2020
# Allows you to run this workflow manually from the Actions tab
2121
workflow_dispatch:
22+
23+
concurrency:
24+
group: ${{ github.ref }}
25+
cancel-in-progress: true
26+
2227
env:
2328
maven_version: 3.8.8
2429
jobs:
@@ -28,14 +33,9 @@ jobs:
2833

2934
strategy:
3035
matrix:
31-
java_version: [ 11 ]
36+
java_version: [ 17, 21-ea ]
3237

3338
steps:
34-
- name: Cancel previous runs of this workflow
35-
uses: styfle/cancel-workflow-action@0.9.1
36-
with:
37-
all_but_latest: true
38-
access_token: ${{ github.token }}
3939
- name: Start MySQL Database
4040
run: |
4141
sudo systemctl start mysql.service

antbuild.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143

144144
<!-- Detect compatible version of JDK (>= 1.8). -->
145145
<condition property="compat.jdk" value="true">
146-
<matches string="${java.version}" pattern="1.(?:[8-9]|[1-9]\d)(?:.\d+)*.*|9.*|1(?:[0-7]).*"/>
146+
<matches string="${java.version}" pattern="1.(?:[8-9]|[1-9]\d)(?:.\d+)*.*|9.*|1(?:[0-7]).*|2(?:[1]).*"/>
147147
</condition>
148148
<echo message="JDK version detected: '${java.version}'"/>
149149
<fail message="A non-compatible version of JDK was detected! Build won't run properly unless running on at least JDK 1.8!." unless="compat.jdk"/>

buildsystem/bsf-2.4.0.jar

111 KB
Binary file not shown.
60.4 KB
Binary file not shown.

buildsystem/compdeps/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@
121121
<!-- CQ #22995 -->
122122
<jboss.logging.version>3.4.1.Final</jboss.logging.version>
123123
<!-- CQ #22996 API, #22997 SPI-->
124-
<jboss.weld.api.version>3.1.SP3</jboss.weld.api.version>
124+
<jboss.weld.api.version>3.1.SP4</jboss.weld.api.version>
125125
<!-- CQ #22998 weld-environment-common, #22999 weld-se-core, #23000 weld-core-impl -->
126-
<jboss.weld.version>3.1.6.Final</jboss.weld.version>
126+
<jboss.weld.version>3.1.9.Final</jboss.weld.version>
127127
</properties>
128128

129129
<build>

buildsystem/org.eclipse.persistence.parent/pom.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0 which is available at
@@ -36,7 +36,8 @@
3636
<properties>
3737
<!-- TOOL Properties -->
3838
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
39-
<tycho.version>1.3.0</tycho.version>
39+
<maven.compiler.release>8</maven.compiler.release>
40+
<tycho.version>3.0.4</tycho.version>
4041
<junit4-version>4.12</junit4-version>
4142
<!-- maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format> Seems it must be in settings.xml -->
4243
<!-- PROJECT Properties -->
@@ -132,6 +133,15 @@
132133
<module>../../foundation/org.eclipse.persistence.oracle.nosql</module>
133134
</modules>
134135
</profile>
136+
<profile>
137+
<id>jdk11</id>
138+
<activation>
139+
<jdk>11</jdk>
140+
</activation>
141+
<properties>
142+
<tycho.version>1.3.0</tycho.version>
143+
</properties>
144+
</profile>
135145
</profiles>
136146

137147
<build>

buildsystem/rhino-1.7.14.jar

1.32 MB
Binary file not shown.

foundation/eclipselink.core.test/antbuild.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!--
33
4-
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0 which is available at
@@ -61,6 +61,9 @@
6161
<echo message="CORETEST_BEGINS..."/>
6262
<available file="../${ant.project.name}" type="dir" property="core_test.is.local"/>
6363
<fail message="Not running from '${ant.project.name}' directory" unless="core_test.is.local"/>
64+
<condition property="is.less.21.jdk" value="true" else="false">
65+
<matches string="${java.version}" pattern="1.(?:[8-9]|[1-9]\d)(?:.\d+)*.*|9.*|1(?:[0-7]).*"/>
66+
</condition>
6467

6568
<!-- Default ant target, compiles and translates resources, does not run tests. -->
6669
<target name="build" depends="clean, compile, package" description="build EclipseLink core tests"/>
@@ -561,13 +564,21 @@
561564
</target>
562565

563566
<!-- Default test target, runs test.class from test.properties (default is LRG). -->
564-
<target name="test" depends="init-testing">
567+
<target name="test" depends="init-testing, test-all-jdks, test-less-jdk21">
568+
<echo message="is.less.21.jdk: ${is.less.21.jdk}"/>
569+
<generate-report/>
570+
</target>
571+
572+
<target name="test-all-jdks">
565573
<test include="**/junit/**/*Test.java"/>
566574
<test include="${test.class}"/>
567-
<test include="org.eclipse.persistence.testing.tests.security.SecurityTestModel"/>
568575
<generate-report/>
569576
</target>
570577

578+
<target name="test-less-jdk21" if="${is.less.21.jdk}">
579+
<test include="org.eclipse.persistence.testing.tests.security.SecurityTestModel"/>
580+
</target>
581+
571582
<!-- Test target to run/debug single ${test.class}. -->
572583
<target name="test-single" depends="init-testing">
573584
<test include="${test.class}"/>

foundation/eclipselink.extension.test/antbuild.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<local name="compat.jdk"/>
120120
<local name="compat.jdk.msg"/>
121121
<condition property="compat.jdk" value="true">
122-
<matches string="${java.version}" pattern="1.(?:[8-9]|[1-9]\d)(?:.\d+)*.*|9.*|1(?:[0-7]).*"/>
122+
<matches string="${java.version}" pattern="1.(?:[8-9]|[1-9]\d)(?:.\d+)*.*|9.*|1(?:[0-7]).*|2(?:[1]).*"/>
123123
</condition>
124124
<condition property="compat.jdk.msg" value=" + JDK: ${java.version}"
125125
else=" - JDK: ${java.version}${line.separator} Build won't run properly unless running at least JDK 1.8.">

moxy/eclipselink.moxy.test/antbuild.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!--
33
4-
Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved.
4+
Copyright (c) 2018, 2023 Oracle and/or its affiliates. All rights reserved.
55
66
This program and the accompanying materials are made available under the
77
terms of the Eclipse Public License v. 2.0 which is available at
@@ -541,7 +541,7 @@
541541
<mkdir dir="${report.dir}/jaxb"/>
542542
<mkdir dir="${build.dir}/${test.dir}/${tmp.dir}"/>
543543
<!-- Can be set e.g. in test.properties to add VM options for a particular platform/driver -->
544-
<property name="additional.jvmargs" value="-Ddummy2=dummy"/>
544+
<property name="additional.jvmargs" value="-Ddummy2=dummy --add-opens java.base/java.math=ALL-UNNAMED"/>
545545
<junit jvm="${test.junit.jvm.exec}" failureproperty="junit.failed.jaxb" logfailedtests="true"
546546
printsummary="yes" fork="true" dir="${build.dir}/${test.dir}" tempdir="${build.dir}/${test.dir}" showoutput="yes" maxmemory="1024m">
547547
<!--<jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"/>-->

0 commit comments

Comments
 (0)