Skip to content

Commit

Permalink
Merge pull request #5634 from dizzzz/ugrade_java21
Browse files Browse the repository at this point in the history
[cicd] Migrate to Java21
  • Loading branch information
dizzzz authored Mar 4, 2025
2 parents ea521e8 + a6d1d3b commit 83191d7
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: '17'
java-version: '21'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
Expand All @@ -36,7 +36,7 @@ jobs:
# Hack around #5450
- name: pull base image
run: |
docker pull --platform linux/amd64 --platform linux/arm64 gcr.io/distroless/java17-debian12:latest
docker pull --platform linux/amd64 --platform linux/arm64 gcr.io/distroless/java21-debian12:latest
- name: Build images
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
- name: Check local images
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: '17'
java-version: '21'
server-id: github
settings-path: ${{ github.workspace }}
- name: Cache Maven packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permissions:
contents: read
env:
MAVEN_OPTS: -DtrimStackTrace=false -D'maven.resolver.transport=wagon'
DEV_JDK: '17'
DEV_JDK: '21'
jobs:
license:
name: License check
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
jvm: ['17', '21']
jvm: ['21']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-xqts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: '17'
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 17
java-version: 21
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Building eXist-db from Source
--------------------------

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).
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).

To build eXist-db:

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

## eXist-db Native XML Database

[![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)
[![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)
[![Coverage Status](https://coveralls.io/repos/github/eXist-db/exist/badge.svg?branch=develop)](https://coveralls.io/github/eXist-db/exist?branch=develop)
[![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)
[![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)
[![Java 17](https://img.shields.io/badge/java-17-blue.svg)](https://adoptopenjdk.net/)
[![Java 21](https://img.shields.io/badge/java-21-blue.svg)](https://adoptopenjdk.net/)
[![License](https://img.shields.io/badge/license-LGPL%202.1-blue.svg)](https://www.gnu.org/licenses/lgpl-2.1.html)
[![Download](https://img.shields.io/github/v/release/eXist-db/exist.svg)](https://github.com/eXist-db/exist/releases/)
[![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)
Expand Down
5 changes: 0 additions & 5 deletions exist-core-jmh/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerVersion>${project.build.target}</compilerVersion>
<source>${project.build.source}</source>
<target>${project.build.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
7 changes: 4 additions & 3 deletions exist-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,7 @@ The BaseX Team. The original license statement is also included below.]]></pream
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
Expand Down Expand Up @@ -1135,9 +1136,9 @@ The BaseX Team. The original license statement is also included below.]]></pream
<configuration>
<forceAjcCompile>true</forceAjcCompile> <!-- Required, otherwise the Aspects are not re-compiled when the src/main/java is recompiled for the test phase -->
<showWeaveInfo>true</showWeaveInfo>
<complianceLevel>${project.build.source}</complianceLevel>
<source>${project.build.source}</source>
<target>${project.build.target}</target>
<complianceLevel>${maven.compiler.release}</complianceLevel>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<!-- sources>
<source>
<basedir>${project.build.sourceDirectory}</basedir>
Expand Down
2 changes: 1 addition & 1 deletion exist-docker/src/main/resources-filtered/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#

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

# Copy eXist-db
COPY LICENSE /exist/LICENSE
Expand Down
4 changes: 1 addition & 3 deletions exist-docker/src/main/resources-filtered/Dockerfile-DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#

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

# Copy eXist-db
Expand Down
2 changes: 1 addition & 1 deletion exist-docker/src/main/resources-filtered/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The images are based on Google Cloud Platform's ["Distroless" Docker Images](htt
* [Docker](https://www.docker.com): `18-stable`
### For building
* [maven](https://maven.apache.org/): `^3.6.0`
* [java](https://www.java.com/): `17`
* [java](https://www.java.com/): `21`
* [bats](https://github.com/bats-core/bats-core): `^1.1.0` (for testing)

## How to use
Expand Down
2 changes: 1 addition & 1 deletion exist-installer/src/main/izpack/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<authors>
<author name="${izpack.installation.info.author.name}" email="${izpack.installation.info.author.email}"/>
</authors>
<javaversion>@{project.build.target}</javaversion>
<javaversion>@{maven.compiler.release}</javaversion>
<requiresjdk>no</requiresjdk>
<run-privileged condition="izpack.windowsinstall"/>
<pack-compression-format>xz</pack-compression-format>
Expand Down
36 changes: 30 additions & 6 deletions exist-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@
</mailingLists>

<properties>
<project.build.source>17</project.build.source>
<project.build.target>17</project.build.target>
<maven.compiler.release>21</maven.compiler.release>
<maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<project.copyright.name>The eXist-db Authors</project.copyright.name>
Expand Down Expand Up @@ -693,10 +694,8 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<version>3.14.0</version>
<configuration>
<source>${project.build.source}</source>
<target>${project.build.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
Expand Down Expand Up @@ -753,7 +752,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<configuration>
<source>${project.build.source}</source>
<source>${maven.compiler.release}</source>
<archive>
<manifest>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
Expand Down Expand Up @@ -977,6 +976,31 @@
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>${maven.compiler.target}</version>
<message>eXist-db requires (at least) OpenJDK ${maven.compiler.target} to build and run.</message>
</requireJavaVersion>
<requireMavenVersion>
<message>Modern plugins require atleast maven 3.6.3.</message>
<version>3.6.3</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
Expand Down

0 comments on commit 83191d7

Please sign in to comment.