From 610fabe2d60e38c66d26f462856cdb44f06ea0ed Mon Sep 17 00:00:00 2001 From: Adrien Lecharpentier Date: Fri, 7 Jun 2024 00:34:09 +0200 Subject: [PATCH] Forward compatibility for Java 17 bytecode (#800) * Support Java 17 bytecode * Update for Ubuntu Noble --------- Co-authored-by: Basil Crow --- pipeline-maven/pom.xml | 56 ++++++++++++++----- .../WithMavenStepMavenExecResolutionTest.java | 4 +- .../maven/docker/JavaGitContainerTest.java | 2 +- .../maven/docker/JavaGitContainer/Dockerfile | 2 +- .../maven/docker/SshdContainer/Dockerfile | 2 +- pom.xml | 14 ++--- 6 files changed, 55 insertions(+), 25 deletions(-) diff --git a/pipeline-maven/pom.xml b/pipeline-maven/pom.xml index 4c18952c..7a952173 100644 --- a/pipeline-maven/pom.xml +++ b/pipeline-maven/pom.xml @@ -502,10 +502,10 @@ - com.spotify - dockerfile-maven-plugin + io.fabric8 + docker-maven-plugin - false + IfNotPresent @@ -515,8 +515,14 @@ process-test-resources - src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/SshdContainer/ - localhost/pipeline-maven/sshd + + + + ${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/SshdContainer/ + + localhost/pipeline-maven/sshd + + @@ -526,8 +532,14 @@ process-test-resources - src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainer/ - localhost/pipeline-maven/java-git + + + + ${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainer/ + + localhost/pipeline-maven/java-git + + @@ -537,8 +549,14 @@ process-test-resources - src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaMavenContainer/ - localhost/pipeline-maven/java-maven-git + + + + ${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaMavenContainer/ + + localhost/pipeline-maven/java-maven-git + + @@ -548,8 +566,14 @@ process-test-resources - src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavasContainer/ - localhost/pipeline-maven/javas + + + + ${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavasContainer/ + + localhost/pipeline-maven/javas + + @@ -559,8 +583,14 @@ process-test-resources - src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaMavenWithMavenHomeContainer/ - localhost/pipeline-maven/maven-home + + + + ${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaMavenWithMavenHomeContainer/ + + localhost/pipeline-maven/maven-home + + diff --git a/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepMavenExecResolutionTest.java b/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepMavenExecResolutionTest.java index 2d89dcf1..575862e8 100644 --- a/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepMavenExecResolutionTest.java +++ b/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepMavenExecResolutionTest.java @@ -148,7 +148,7 @@ public void testPreInstalledMavenRecognizedWithoutMavenHome() throws Exception { ); // @formatter:on - jenkinsRule.assertLogContains("Apache Maven 3.6.3", run); + jenkinsRule.assertLogContains("Apache Maven 3.8.7", run); jenkinsRule.assertLogContains( "using Maven installation provided by the build agent with executable /usr/bin/mvn", run); } @@ -172,7 +172,7 @@ public void testPreInstalledMavenRecognizedWithMavenHome() throws Exception { ); // @formatter:on - jenkinsRule.assertLogContains("Apache Maven 3.6.3", run); + jenkinsRule.assertLogContains("Apache Maven 3.8.7", run); jenkinsRule.assertLogContains( "using Maven installation provided by the build agent with the environment variable MAVEN_HOME=/usr/share/maven", run); diff --git a/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainerTest.java b/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainerTest.java index da2ce386..16de3741 100644 --- a/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainerTest.java +++ b/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainerTest.java @@ -46,7 +46,7 @@ public class JavaGitContainerTest extends AbstractIntegrationTest { @Test public void smokes() throws Exception { assertThat(containerRule.execInContainer("java", "-version").getStderr()) - .contains("openjdk version \"11"); + .contains("openjdk version \"17"); assertThat(containerRule.execInContainer("git", "--version").getStdout()) .contains("git version 2."); } diff --git a/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainer/Dockerfile b/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainer/Dockerfile index 43c612d7..047c2c3a 100644 --- a/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainer/Dockerfile +++ b/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainer/Dockerfile @@ -3,7 +3,7 @@ FROM localhost/pipeline-maven/sshd RUN apt-get update && \ apt-get install --no-install-recommends -y \ software-properties-common \ - openjdk-11-jdk-headless \ + openjdk-17-jdk-headless \ curl \ ant \ git diff --git a/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/SshdContainer/Dockerfile b/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/SshdContainer/Dockerfile index 1fcb4504..d315017f 100644 --- a/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/SshdContainer/Dockerfile +++ b/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/SshdContainer/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:jammy +FROM ubuntu:noble # install SSHD RUN apt-get update -y && \ diff --git a/pom.xml b/pom.xml index 7851bdc7..fd3cd030 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.jenkins-ci.plugins plugin - 4.82 + 4.83 @@ -100,8 +100,8 @@ 8.4.0-31.va_b_5ce7933762 42.7.2-40.v76d376d65c77 4.53 - 2982.vdce2153031a_0 - 2.414.3 + 3105.v672692894683 + 2.426.3 5.10.2 3.4.0 0.3.5 @@ -109,7 +109,7 @@ 3.8.8 5.6.0 3.5.1 - 1.4.13 + 0.44.0 3.3.0 2.0.13 false @@ -120,7 +120,7 @@ io.jenkins.tools.bom - bom-2.414.x + bom-2.426.x ${jenkins-tools-bom.version} pom import @@ -252,8 +252,8 @@ - com.spotify - dockerfile-maven-plugin + io.fabric8 + docker-maven-plugin ${plugin-dockerfile.version}