Skip to content

Commit

Permalink
Forward compatibility for Java 17 bytecode (#800)
Browse files Browse the repository at this point in the history
* Support Java 17 bytecode

* Update for Ubuntu Noble

---------

Co-authored-by: Basil Crow <[email protected]>
  • Loading branch information
alecharp and basil authored Jun 6, 2024
1 parent b76115c commit 610fabe
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 25 deletions.
56 changes: 43 additions & 13 deletions pipeline-maven/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,10 @@
<build>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<pullNewerImage>false</pullNewerImage>
<imagePullPolicy>IfNotPresent</imagePullPolicy>
</configuration>
<executions>
<execution>
Expand All @@ -515,8 +515,14 @@
</goals>
<phase>process-test-resources</phase>
<configuration>
<contextDirectory>src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/SshdContainer/</contextDirectory>
<repository>localhost/pipeline-maven/sshd</repository>
<images>
<image>
<build>
<contextDir>${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/SshdContainer/</contextDir>
</build>
<name>localhost/pipeline-maven/sshd</name>
</image>
</images>
</configuration>
</execution>
<execution>
Expand All @@ -526,8 +532,14 @@
</goals>
<phase>process-test-resources</phase>
<configuration>
<contextDirectory>src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainer/</contextDirectory>
<repository>localhost/pipeline-maven/java-git</repository>
<images>
<image>
<build>
<contextDir>${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaGitContainer/</contextDir>
</build>
<name>localhost/pipeline-maven/java-git</name>
</image>
</images>
</configuration>
</execution>
<execution>
Expand All @@ -537,8 +549,14 @@
</goals>
<phase>process-test-resources</phase>
<configuration>
<contextDirectory>src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaMavenContainer/</contextDirectory>
<repository>localhost/pipeline-maven/java-maven-git</repository>
<images>
<image>
<build>
<contextDir>${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaMavenContainer/</contextDir>
</build>
<name>localhost/pipeline-maven/java-maven-git</name>
</image>
</images>
</configuration>
</execution>
<execution>
Expand All @@ -548,8 +566,14 @@
</goals>
<phase>process-test-resources</phase>
<configuration>
<contextDirectory>src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavasContainer/</contextDirectory>
<repository>localhost/pipeline-maven/javas</repository>
<images>
<image>
<build>
<contextDir>${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavasContainer/</contextDir>
</build>
<name>localhost/pipeline-maven/javas</name>
</image>
</images>
</configuration>
</execution>
<execution>
Expand All @@ -559,8 +583,14 @@
</goals>
<phase>process-test-resources</phase>
<configuration>
<contextDirectory>src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaMavenWithMavenHomeContainer/</contextDirectory>
<repository>localhost/pipeline-maven/maven-home</repository>
<images>
<image>
<build>
<contextDir>${project.basedir}/src/test/resources/org/jenkinsci/plugins/pipeline/maven/docker/JavaMavenWithMavenHomeContainer/</contextDir>
</build>
<name>localhost/pipeline-maven/maven-home</name>
</image>
</images>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:jammy
FROM ubuntu:noble

# install SSHD
RUN apt-get update -y && \
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.82</version>
<version>4.83</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -100,16 +100,16 @@
<jenkins-plugin-mysql.version>8.4.0-31.va_b_5ce7933762</jenkins-plugin-mysql.version>
<jenkins-plugin-postgresql.version>42.7.2-40.v76d376d65c77</jenkins-plugin-postgresql.version>
<jenkins-plugin-tasks.version>4.53</jenkins-plugin-tasks.version>
<jenkins-tools-bom.version>2982.vdce2153031a_0</jenkins-tools-bom.version>
<jenkins.version>2.414.3</jenkins.version>
<jenkins-tools-bom.version>3105.v672692894683</jenkins-tools-bom.version>
<jenkins.version>2.426.3</jenkins.version>
<junit.version>5.10.2</junit.version>
<mariadb-client.version>3.4.0</mariadb-client.version>
<maven-plugin-sisu.version>0.3.5</maven-plugin-sisu.version>
<maven-shared-utils.version>3.4.2</maven-shared-utils.version>
<maven.version>3.8.8</maven.version>
<mockito.version>5.6.0</mockito.version>
<plexus-utils.version>3.5.1</plexus-utils.version>
<plugin-dockerfile.version>1.4.13</plugin-dockerfile.version>
<plugin-dockerfile.version>0.44.0</plugin-dockerfile.version>
<plugin-exec.version>3.3.0</plugin-exec.version>
<slf4j.version>2.0.13</slf4j.version>
<spotless.check.skip>false</spotless.check.skip>
Expand All @@ -120,7 +120,7 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.414.x</artifactId>
<artifactId>bom-2.426.x</artifactId>
<version>${jenkins-tools-bom.version}</version>
<type>pom</type>
<scope>import</scope>
Expand Down Expand Up @@ -252,8 +252,8 @@
<pluginManagement>
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${plugin-dockerfile.version}</version>
</plugin>
<plugin>
Expand Down

0 comments on commit 610fabe

Please sign in to comment.