Skip to content

Commit 83191d7

Browse files
authored
Merge pull request #5634 from dizzzz/ugrade_java21
[cicd] Migrate to Java21
2 parents ea521e8 + a6d1d3b commit 83191d7

File tree

14 files changed

+52
-34
lines changed

14 files changed

+52
-34
lines changed

.github/workflows/ci-container.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
- uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 1
14-
- name: Set up JDK 17
14+
- name: Set up JDK 21
1515
uses: actions/setup-java@v4
1616
with:
1717
distribution: liberica
18-
java-version: '17'
18+
java-version: '21'
1919
- name: Set up QEMU
2020
uses: docker/setup-qemu-action@v3
2121
with:
@@ -36,7 +36,7 @@ jobs:
3636
# Hack around #5450
3737
- name: pull base image
3838
run: |
39-
docker pull --platform linux/amd64 --platform linux/arm64 gcr.io/distroless/java17-debian12:latest
39+
docker pull --platform linux/amd64 --platform linux/arm64 gcr.io/distroless/java21-debian12:latest
4040
- name: Build images
4141
run: mvn -V -B -q -Pdocker -DskipTests -Ddependency-check.skip=true -P !mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives clean package
4242
- name: Check local images

.github/workflows/ci-snapshots.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 1
18-
- name: Set up JDK 17
18+
- name: Set up JDK 21
1919
uses: actions/setup-java@v4
2020
with:
2121
distribution: liberica
22-
java-version: '17'
22+
java-version: '21'
2323
server-id: github
2424
settings-path: ${{ github.workspace }}
2525
- name: Cache Maven packages

.github/workflows/ci-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ permissions:
44
contents: read
55
env:
66
MAVEN_OPTS: -DtrimStackTrace=false -D'maven.resolver.transport=wagon'
7-
DEV_JDK: '17'
7+
DEV_JDK: '21'
88
jobs:
99
license:
1010
name: License check
@@ -40,7 +40,7 @@ jobs:
4040
fail-fast: false
4141
matrix:
4242
os: [ubuntu-latest, windows-latest, macOS-latest]
43-
jvm: ['17', '21']
43+
jvm: ['21']
4444
runs-on: ${{ matrix.os }}
4545
steps:
4646
- uses: actions/checkout@v4

.github/workflows/ci-xqts.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12-
- name: Set up JDK 17
12+
- name: Set up JDK 21
1313
uses: actions/setup-java@v4
1414
with:
1515
distribution: liberica
16-
java-version: '17'
16+
java-version: '21'
1717
- name: Cache Maven packages
1818
uses: actions/cache@v4
1919
with:

.github/workflows/sonarcloud.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
- uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
17-
- name: Set up JDK 17
17+
- name: Set up JDK 21
1818
uses: actions/setup-java@v4
1919
with:
2020
distribution: liberica
21-
java-version: 17
21+
java-version: 21
2222
- name: Cache SonarCloud packages
2323
uses: actions/cache@v4
2424
with:

BUILD.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Building eXist-db from Source
22
--------------------------
33

4-
eXist-db itself is written in Java 17. The build system is [Apache Maven](http://maven.apache.org/). If you're not familiar with Git, we recommend [this excellent online interactive tutorial](http://try.github.io).
4+
eXist-db itself is written in and qualified with Java 21. The build system is [Apache Maven](http://maven.apache.org/). If you're not familiar with Git, we recommend [this excellent online interactive tutorial](http://try.github.io).
55

66
To build eXist-db:
77

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
## eXist-db Native XML Database
88

9-
[![Build Status](https://github.com/eXist-db/exist/actions/workflows/ci-build.yml/badge.svg?branch=develop)](https://github.com/eXist-db/exist/actions/workflows/ci-build.yml)
9+
[![Build Status](https://github.com/eXist-db/exist/actions/workflows/ci-test.yml/badge.svg?branch=develop)](https://github.com/eXist-db/exist/actions/workflows/ci-build.yml)
1010
[![Coverage Status](https://coveralls.io/repos/github/eXist-db/exist/badge.svg?branch=develop)](https://coveralls.io/github/eXist-db/exist?branch=develop)
1111
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ae1c8a7eb1164e919b0ac3c8588560c6)](https://www.codacy.com/gh/eXist-db/exist/dashboard?utm_source=github.com&utm_medium=referral&utm_content=eXist-db/exist&utm_campaign=Badge_Grade)
1212
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=eXist-db_exist&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=eXist-db_exist)
13-
[![Java 17](https://img.shields.io/badge/java-17-blue.svg)](https://adoptopenjdk.net/)
13+
[![Java 21](https://img.shields.io/badge/java-21-blue.svg)](https://adoptopenjdk.net/)
1414
[![License](https://img.shields.io/badge/license-LGPL%202.1-blue.svg)](https://www.gnu.org/licenses/lgpl-2.1.html)
1515
[![Download](https://img.shields.io/github/v/release/eXist-db/exist.svg)](https://github.com/eXist-db/exist/releases/)
1616
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.exist-db/exist/badge.svg)](https://search.maven.org/search?q=g:org.exist-db)

exist-core-jmh/pom.xml

-5
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@
121121
<plugin>
122122
<groupId>org.apache.maven.plugins</groupId>
123123
<artifactId>maven-compiler-plugin</artifactId>
124-
<configuration>
125-
<compilerVersion>${project.build.target}</compilerVersion>
126-
<source>${project.build.source}</source>
127-
<target>${project.build.target}</target>
128-
</configuration>
129124
</plugin>
130125
<plugin>
131126
<groupId>org.apache.maven.plugins</groupId>

exist-core/pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,7 @@ The BaseX Team. The original license statement is also included below.]]></pream
10941094
</plugin>
10951095

10961096
<plugin>
1097+
<groupId>org.apache.maven.plugins</groupId>
10971098
<artifactId>maven-compiler-plugin</artifactId>
10981099
<executions>
10991100
<execution>
@@ -1135,9 +1136,9 @@ The BaseX Team. The original license statement is also included below.]]></pream
11351136
<configuration>
11361137
<forceAjcCompile>true</forceAjcCompile> <!-- Required, otherwise the Aspects are not re-compiled when the src/main/java is recompiled for the test phase -->
11371138
<showWeaveInfo>true</showWeaveInfo>
1138-
<complianceLevel>${project.build.source}</complianceLevel>
1139-
<source>${project.build.source}</source>
1140-
<target>${project.build.target}</target>
1139+
<complianceLevel>${maven.compiler.release}</complianceLevel>
1140+
<source>${maven.compiler.source}</source>
1141+
<target>${maven.compiler.target}</target>
11411142
<!-- sources>
11421143
<source>
11431144
<basedir>${project.build.sourceDirectory}</basedir>

exist-docker/src/main/resources-filtered/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121
#
2222

23-
FROM gcr.io/distroless/java17-debian12:latest
23+
FROM gcr.io/distroless/java21-debian12:latest
2424

2525
# Copy eXist-db
2626
COPY LICENSE /exist/LICENSE

exist-docker/src/main/resources-filtered/Dockerfile-DEBUG

+1-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121
#
2222

23-
# Use JDK 17 in Debian as our production image gcr.io/distroless/java is based on Debian with just a JRE)
24-
FROM debian:bookworm-slim
23+
FROM openjdk:21-jdk-slim-bullseye
2524
RUN apt-get update && apt-get -y dist-upgrade
26-
RUN apt-get install -y openjdk-17-jdk-headless
2725
RUN apt-get install -y expat fontconfig # Install tools required by FOP
2826

2927
# Copy eXist-db

exist-docker/src/main/resources-filtered/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The images are based on Google Cloud Platform's ["Distroless" Docker Images](htt
1717
* [Docker](https://www.docker.com): `18-stable`
1818
### For building
1919
* [maven](https://maven.apache.org/): `^3.6.0`
20-
* [java](https://www.java.com/): `17`
20+
* [java](https://www.java.com/): `21`
2121
* [bats](https://github.com/bats-core/bats-core): `^1.1.0` (for testing)
2222

2323
## How to use

exist-installer/src/main/izpack/install.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<authors>
3939
<author name="${izpack.installation.info.author.name}" email="${izpack.installation.info.author.email}"/>
4040
</authors>
41-
<javaversion>@{project.build.target}</javaversion>
41+
<javaversion>@{maven.compiler.release}</javaversion>
4242
<requiresjdk>no</requiresjdk>
4343
<run-privileged condition="izpack.windowsinstall"/>
4444
<pack-compression-format>xz</pack-compression-format>

exist-parent/pom.xml

+30-6
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@
9292
</mailingLists>
9393

9494
<properties>
95-
<project.build.source>17</project.build.source>
96-
<project.build.target>17</project.build.target>
95+
<maven.compiler.release>21</maven.compiler.release>
96+
<maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
97+
<maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
9798
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
9899

99100
<project.copyright.name>The eXist-db Authors</project.copyright.name>
@@ -693,10 +694,8 @@
693694
<plugin>
694695
<groupId>org.apache.maven.plugins</groupId>
695696
<artifactId>maven-compiler-plugin</artifactId>
696-
<version>3.13.0</version>
697+
<version>3.14.0</version>
697698
<configuration>
698-
<source>${project.build.source}</source>
699-
<target>${project.build.target}</target>
700699
<encoding>${project.build.sourceEncoding}</encoding>
701700
</configuration>
702701
</plugin>
@@ -753,7 +752,7 @@
753752
<artifactId>maven-javadoc-plugin</artifactId>
754753
<version>3.11.2</version>
755754
<configuration>
756-
<source>${project.build.source}</source>
755+
<source>${maven.compiler.release}</source>
757756
<archive>
758757
<manifest>
759758
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
@@ -977,6 +976,31 @@
977976
</pluginManagement>
978977

979978
<plugins>
979+
<plugin>
980+
<groupId>org.apache.maven.plugins</groupId>
981+
<artifactId>maven-enforcer-plugin</artifactId>
982+
<version>3.5.0</version>
983+
<executions>
984+
<execution>
985+
<id>enforce-java</id>
986+
<goals>
987+
<goal>enforce</goal>
988+
</goals>
989+
<configuration>
990+
<rules>
991+
<requireJavaVersion>
992+
<version>${maven.compiler.target}</version>
993+
<message>eXist-db requires (at least) OpenJDK ${maven.compiler.target} to build and run.</message>
994+
</requireJavaVersion>
995+
<requireMavenVersion>
996+
<message>Modern plugins require atleast maven 3.6.3.</message>
997+
<version>3.6.3</version>
998+
</requireMavenVersion>
999+
</rules>
1000+
</configuration>
1001+
</execution>
1002+
</executions>
1003+
</plugin>
9801004
<plugin>
9811005
<groupId>com.mycila</groupId>
9821006
<artifactId>license-maven-plugin</artifactId>

0 commit comments

Comments
 (0)