From f4afe589dac347fce421b8e8da5d1cbbb9e8752e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trung=20L=C3=AA?= <8@tle.id.au> Date: Thu, 21 Sep 2023 00:40:36 +1000 Subject: [PATCH] Build with default JDK 21 (rhbz#2239868) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Trung Lê <8@tle.id.au> --- gating.yaml | 3 +++ maven.spec | 29 ++++++++++++++++++++++++----- plans/javapackages.fmf | 10 +++++++++- plans/smoke.fmf | 26 ++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 6 deletions(-) diff --git a/gating.yaml b/gating.yaml index ba3a77f..8d8481d 100644 --- a/gating.yaml +++ b/gating.yaml @@ -8,9 +8,12 @@ rules: - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke/jdk8/full.functional} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke/jdk11/full.functional} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke/jdk17/full.functional} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke/jdk21/full.functional} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke/jdk8/headless.functional} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke/jdk11/headless.functional} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke/jdk17/headless.functional} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke/jdk21/headless.functional} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/javapackages/jdk8.functional} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/javapackages/jdk11.functional} - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/javapackages/jdk17.functional} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/javapackages/jdk21.functional} diff --git a/maven.spec b/maven.spec index dada895..a4ed765 100644 --- a/maven.spec +++ b/maven.spec @@ -7,7 +7,7 @@ Name: maven Epoch: 1 Version: 3.9.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Java project management and project comprehension tool # maven itself is Apache-2.0 # bundled slf4j is MIT @@ -86,7 +86,7 @@ BuildRequires: mvn(org.slf4j:slf4j-simple::sources:) Requires: %{name}-lib = %{epoch}:%{version}-%{release} Requires: %{name}-jdk-binding = %{epoch}:%{version}-%{release} -Suggests: %{name}-openjdk17 = %{epoch}:%{version}-%{release} +Suggests: %{name}-openjdk21 = %{epoch}:%{version}-%{release} Requires(post): alternatives Requires(postun): alternatives @@ -147,6 +147,18 @@ Conflicts: maven-jdk-binding %description openjdk17 Configures Maven to run with OpenJDK 17. +%package openjdk21 +Summary: OpenJDK 21 binding for Maven +RemovePathPostfixes: -openjdk21 +Provides: maven-jdk-binding = %{epoch}:%{version}-%{release} +Requires: maven = %{epoch}:%{version}-%{release} +Requires: java-21-openjdk-headless +Recommends: java-21-openjdk-devel +Conflicts: maven-jdk-binding + +%description openjdk21 +Configures Maven to run with OpenJDK 21. + %{?javadoc_package} %prep @@ -155,9 +167,9 @@ Configures Maven to run with OpenJDK 17. find -name '*.java' -exec sed -i 's/\r//' {} + find -name 'pom.xml' -exec sed -i 's/\r//' {} + -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 +%patch -P 1 -p1 +%patch -P 2 -p1 +%patch -P 3 -p1 # not really used during build, but a precaution find -name '*.jar' -not -path '*/test/*' -delete @@ -252,6 +264,7 @@ install -d -m 755 %{buildroot}%{_javaconfdir}/ echo JAVA_HOME=%{_jvmlibdir}/jre-1.8.0-openjdk >%{buildroot}%{_javaconfdir}/maven.conf-openjdk8 echo JAVA_HOME=%{_jvmlibdir}/jre-11-openjdk >%{buildroot}%{_javaconfdir}/maven.conf-openjdk11 echo JAVA_HOME=%{_jvmlibdir}/jre-17-openjdk >%{buildroot}%{_javaconfdir}/maven.conf-openjdk17 +echo JAVA_HOME=%{_jvmlibdir}/jre-21-openjdk >%{buildroot}%{_javaconfdir}/maven.conf-openjdk21 %post @@ -297,7 +310,13 @@ if [[ $1 -eq 0 ]]; then update-alternatives --remove mvn %{homedir}/bin/mvn; fi %files openjdk17 %config %{_javaconfdir}/maven.conf-openjdk17 +%files openjdk21 +%config %{_javaconfdir}/maven.conf-openjdk21 + %changelog +* Thu Sep 21 2023 Trung Lê <8@tle.id.au> - 1:3.9.4-3 +- Add maven-openjdk21 + * Fri Sep 01 2023 Mikolaj Izdebski - 1:3.9.4-2 - Convert License tag to SPDX format diff --git a/plans/javapackages.fmf b/plans/javapackages.fmf index a5aaa28..8b8e6b3 100644 --- a/plans/javapackages.fmf +++ b/plans/javapackages.fmf @@ -1,13 +1,14 @@ discover: how: fmf url: https://src.fedoraproject.org/tests/javapackages - ref: f37 + ref: f39 prepare: how: install exclude: - maven-openjdk8 - maven-openjdk11 - maven-openjdk17 + - maven-openjdk21 execute: how: tmt @@ -28,3 +29,10 @@ execute: prepare+: exclude-: - maven-openjdk17 + +/jdk21: + summary: Run javapackages-specific tests (OpenJDK 21) + prepare+: + exclude-: + - maven-openjdk21 + diff --git a/plans/smoke.fmf b/plans/smoke.fmf index be97ea9..754b599 100644 --- a/plans/smoke.fmf +++ b/plans/smoke.fmf @@ -13,6 +13,7 @@ execute: exclude: - maven-openjdk11 - maven-openjdk17 + - maven-openjdk21 /full: summary: Basic smoke tests (OpenJDK 8 full) @@ -36,6 +37,7 @@ execute: exclude: - maven-openjdk8 - maven-openjdk17 + - maven-openjdk21 /full: summary: Basic smoke tests (OpenJDK 11 full) @@ -57,6 +59,7 @@ execute: exclude: - maven-openjdk8 - maven-openjdk11 + - maven-openjdk21 /full: summary: Basic smoke tests (OpenJDK 17 full) @@ -69,3 +72,26 @@ execute: - how: shell script: | dnf -y erase java-*-openjdk + +/jdk21: + environment: + OPENJDK_VERSION: 21 + prepare: + - how: install + exclude: + - maven-openjdk8 + - maven-openjdk11 + - maven-openjdk17 + + /full: + summary: Basic smoke tests (OpenJDK 21 full) + + /headless: + summary: Basic smoke tests (OpenJDK 21 headless) + environment+: + OPENJDK_HEADLESS: true + prepare+: + - how: shell + script: | + dnf -y erase java-*-openjdk +