diff --git a/Jenkinsfile b/Jenkinsfile index 1f3f4570..d142113b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -84,6 +84,22 @@ def tools = [ ''' }, ], + [ + name: 'maven', + dockerfile: 'maven/3-jdk-21-debian.Dockerfile', + imageTag: '3-jdk-21-debian', + dependencySnapshotting: true, + testImageHook: { + sh ''' + mvn -v + cat /etc/debian_version + # We explicitly approve updates of Debian to know what is going on. + grep "^11\\.8\\$" /etc/debian_version + test -e "$JAVA_HOME/bin/javac" + java -version 2>&1 | grep "openjdk version \\"21" + ''' + }, + ], [ name: 'sonar-scanner', dependencySnapshotting: true, diff --git a/README.md b/README.md index ac94fcf6..014f63b7 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ used in build pipelines. - [maven3-jdk-11-alpine](maven/) - [maven3-jdk-11-debian](maven/) - [maven3-jdk-17-debian](maven/) +- [maven3-jdk-21-debian](maven/) - ~~[node12-alpine](node/)~~ (deprecated) - ~~[node14](node/)~~ (deprecated) - ~~[node14-browsers](node/)~~ (deprecated) diff --git a/maven/3-jdk-21-debian.Dockerfile b/maven/3-jdk-21-debian.Dockerfile new file mode 100644 index 00000000..a0572063 --- /dev/null +++ b/maven/3-jdk-21-debian.Dockerfile @@ -0,0 +1,38 @@ +FROM azul/zulu-openjdk-debian:21@sha256:b10a53a05c6fcdf4b27f83300e67e2c889883143c8164e8d8a2d0498ec254376 + +RUN set -ex; \ + apt-get update; \ + apt-get install -y \ + curl \ + git \ + jq \ + openssh-client \ + procps \ + wget \ + zip \ + # Needed for `npm install keytar` for cals-cli. + libsecret-1-dev \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + # Install Node. + wget https://raw.githubusercontent.com/capralifecycle/buildtools-snippets/master/tools/node/install.sh -O /tmp/script.sh; \ + sh /tmp/script.sh; \ + rm /tmp/script.sh; \ + node --version; \ + npm --version; \ + \ + # Install Docker client. + wget https://raw.githubusercontent.com/capralifecycle/buildtools-snippets/master/tools/docker/install.sh -O- | sh; \ + docker --version; \ + \ + # Install Maven. + wget https://raw.githubusercontent.com/capralifecycle/buildtools-snippets/master/tools/maven-3/install.sh -O- | sh; \ + mvn -version; \ + \ + # Add a user with the UID that Jenkins will use during builds. + # This solves issues for some builds that require the user to exist. + useradd -u 1000 jenkins