Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cicd] Migrate to Java21 #5634

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Conversation

dizzzz
Copy link
Member

@dizzzz dizzzz commented Feb 23, 2025

Migrate to Java21, including smaller cleanups in pom.xml to make configuration more consistent.

Todo:

  • Test build/run on OSses (server)
  • Test installer- @reinhapa
  • Test build in Github
  • Update docker build - @duncdrum
  • Mac specific updates needed? - @duncdrum

@dizzzz dizzzz requested a review from a team as a code owner February 23, 2025 20:35
@dizzzz dizzzz mentioned this pull request Feb 23, 2025
@dizzzz
Copy link
Member Author

dizzzz commented Feb 23, 2025

Mac / silicon : al OK 👍🏼

wessels@Mac exist-distribution-7.0.0-SNAPSHOT-dir % setjava21
wessels@Mac exist-distribution-7.0.0-SNAPSHOT-dir % ./bin/startup.sh 
23 Feb 2025 22:24:22,557 [main] INFO  (JettyStart.java [run]:208) - Running with Java 21.0.6 [BellSoft (OpenJDK 64-Bit Server VM) in /Library/Java/JavaVirtualMachines/liberica-jdk-21-full.jdk/Contents/Home] 
23 Feb 2025 22:24:22,558 [main] INFO  (JettyStart.java [run]:215) - Approximate maximum amount of memory for JVM: 16 GB 
23 Feb 2025 22:24:22,558 [main] INFO  (JettyStart.java [run]:216) - Number of processors available to JVM: 16 
23 Feb 2025 22:24:22,559 [main] INFO  (JettyStart.java [run]:218) - Running as user 'wessels' 
23 Feb 2025 22:24:22,559 [main] INFO  (JettyStart.java [run]:219) - [eXist Home : /mypath/eXist-db/exist-distribution/target/exist-distribution-7.0.0-SNAPSHOT-dir] 
23 Feb 2025 22:24:22,559 [main] INFO  (JettyStart.java [run]:220) - [eXist Version : 7.0.0-SNAPSHOT] 
23 Feb 2025 22:24:22,559 [main] INFO  (JettyStart.java [run]:221) - [eXist Build : 2025-02-23T21:06:49Z] 
23 Feb 2025 22:24:22,560 [main] INFO  (JettyStart.java [run]:222) - [Git commit : 2a5f591990811703f9f99f1fa1c1d4b8e988c71b] 
23 Feb 2025 22:24:22,560 [main] INFO  (JettyStart.java [run]:223) - [Git commit timestamp : 20250223215305] 
23 Feb 2025 22:24:22,560 [main] INFO  (JettyStart.java [run]:225) - [Operating System : Mac OS X 15.3.1 aarch64] 
23 Feb 2025 22:24:22,560 [main] INFO  (JettyStart.java [run]:226) - [log4j.configurationFile : /mypath/eXist-db/exist-distribution/target/exist-distribution-7.0.0-SNAPSHOT-dir/etc/log4j2.xml] 
23 Feb 2025 22:24:22,566 [main] INFO  (JettyStart.java [run]:227) - [jetty Version: 11.0.24] 
23 Feb 2025 22:24:22,566 [main] INFO  (JettyStart.java [run]:228) - [jetty.home : /mypath/eXist-db/exist-distribution/target/exist-distribution-7.0.0-SNAPSHOT-dir] 
23 Feb 2025 22:24:22,566 [main] INFO  (JettyStart.java [run]:229) - [jetty.base : /mypath/eXist-db/exist-distribution/target/exist-distribution-7.0.0-SNAPSHOT-dir] 
23 Feb 2025 22:24:22,566 [main] INFO  (JettyStart.java [run]:230) - [jetty configuration : /mypath/eXist-db/exist-distribution/target/exist-distribution-7.0.0-SNAPSHOT-dir/etc/jetty/standard.enabled-jetty-confi

@duncdrum
Copy link
Contributor

@dizzzz I m not sure why this fails on CI, could be related to changes to maven.compiled.version (what is that btw?) Does the docker build fail on your local system as well if you activate the docker profile?

@dizzzz
Copy link
Member Author

dizzzz commented Feb 25, 2025

locally the build fails as well, it looks it has to do with installing openjdk-21-jdk-headless - is this the correct one?

INFO] DOCKER> #7 0.064 Reading package lists...
[INFO] DOCKER> #7 0.271 Building dependency tree...
[INFO] DOCKER> #7 0.319 Reading state information...
[INFO] DOCKER> #7 0.321 E: Unable to locate package openjdk-21-jdk-headless
[INFO] DOCKER> #7 ERROR: process "/bin/sh -c apt-get install -y openjdk-21-jdk-headless" did not complete successfully: exit code: 100
[INFO] DOCKER> ------
[INFO] DOCKER> > [3/9] RUN apt-get install -y openjdk-21-jdk-headless:
[INFO] DOCKER>
[INFO] DOCKER> 0.271 Building dependency tree...
[INFO] DOCKER> 0.319 Reading state information...
[INFO] DOCKER> 0.321 E: Unable to locate package openjdk-21-jdk-headless

about maven.compiled.version ; where did you see this? the following

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

are default properties for the recent maven-compiler-plugin, so it is not needed to pass them to compiler plugin definitions in individual pom files.

with maven.compiler.release we can make sure that the compiler performs additional checks on JDK compatibility, eg if we build with java23 in future, we explicitly can only use APIs from Java21.

@duncdrum it is only the -DEBUG that is failing, the other image works just fine.

@dizzzz
Copy link
Member Author

dizzzz commented Feb 25, 2025

@duncdrum why do we use openjdk-XX-jdk-headless i.s.o openjdk-XX-jre-headless ?

@duncdrum
Copy link
Contributor

duncdrum commented Feb 25, 2025

@dizzzz the tagging scheme changed try openjdk:21-jdk-slim-bullseye instead. As to the why and how of these images, they were added by adam in order to... not use the debug images provided by distroless?!?

@duncdrum
Copy link
Contributor

@dizzzz I m not aware of any mac specific things, other than the installer correctly picking up local JREs irrespective of architecture. But that seems a separate concern as it applies to all JREs and not just 21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants