Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ properties([

def axes = [
platforms: ['linux', 'windows'],
jdks: [11, 17, 21],
jdks: [17, 21],
]

stage('Record build') {
retry(conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()], count: 2) {
node('maven-11') {
node('maven-17') {
infra.checkoutSCM()

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,11 @@ public class JavaVersionRecommendationAdminMonitor extends AdministrativeMonitor

static {
NavigableMap<Integer, LocalDate> supportedVersions = new TreeMap<>();
// Adjust Java 11 end of life date for weekly and LTS
// Adjust Java 11 end of life date for LTS
if (Jenkins.VERSION.split("[.]").length > 2) {
// LTS will require Java 17 or newer beginning 30 Oct 2024
// https://groups.google.com/g/jenkinsci-dev/c/gsXAqOQQEPc/m/VT9IBYdmAQAJ
supportedVersions.put(11, LocalDate.of(2024, 9, 30)); // Temurin: 2024-10-31
} else {
// Weekly will require Java 17 or newer beginning 18 Jun 2024
// https://groups.google.com/g/jenkinsci-dev/c/gsXAqOQQEPc/m/4fn4Un1iAwAJ
supportedVersions.put(11, LocalDate.of(2024, 6, 18)); // Temurin: 2024-10-31
}
supportedVersions.put(17, LocalDate.of(2026, 3, 31)); // Temurin: 2027-10-31
supportedVersions.put(21, LocalDate.of(2027, 9, 30)); // Temurin: 2029-09-30
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci</groupId>
<artifactId>jenkins</artifactId>
<version>1.115</version>
<version>1.116</version>
<relativePath />
</parent>

Expand Down
45 changes: 45 additions & 0 deletions war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,51 @@ THE SOFTWARE.
<build>
<finalName>jenkins</finalName>
<plugins>
<!-- TODO When Java 11 usage declines to a terminal level, this can be deleted. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>display-info</id>
<configuration>
<rules>
<requireJavaVersion>
<version>11</version>
</requireJavaVersion>
<enforceBytecodeVersion>
<maxJdkVersion>11</maxJdkVersion>
<excludes>
<exclude>org.jenkins-ci:commons-jelly</exclude>
<exclude>org.jenkins-ci.main:cli</exclude>
<exclude>org.jenkins-ci.main:jenkins-core</exclude>
<exclude>org.jenkins-ci.main:websocket-jetty10</exclude>
<exclude>org.jenkins-ci.main:websocket-spi</exclude>
<exclude>org.kohsuke.stapler:stapler</exclude>
<exclude>org.kohsuke.stapler:stapler-groovy</exclude>
<exclude>org.kohsuke.stapler:stapler-jelly</exclude>
</excludes>
</enforceBytecodeVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>11</release>
<testRelease>11</testRelease>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<!-- version specified in grandparent pom -->
Expand Down
2 changes: 1 addition & 1 deletion war/src/main/java/executable/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class Main {
* This list must remain synchronized with the one in {@code
* JavaVersionRecommendationAdminMonitor}.
*/
private static final NavigableSet<Integer> SUPPORTED_JAVA_VERSIONS = new TreeSet<>(List.of(11, 17, 21));
private static final NavigableSet<Integer> SUPPORTED_JAVA_VERSIONS = new TreeSet<>(List.of(17, 21));

/**
* Sets custom session cookie name.
Expand Down
18 changes: 6 additions & 12 deletions war/src/test/java/executable/MainTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,28 @@ class MainTest {
void unsupported() {
assertJavaCheckFails(8, false);
assertJavaCheckFails(8, true);
assertJavaCheckFails(11, false);
assertJavaCheckFails(11, true);
}

@Test
void supported() {
assertJavaCheckPasses(11, false);
assertJavaCheckPasses(11, true);
assertJavaCheckPasses(17, false);
assertJavaCheckPasses(17, true);
assertJavaCheckPasses(21, false);
assertJavaCheckPasses(21, true);
}

@Test
void future() {
assertJavaCheckFails(12, false);
assertJavaCheckFails(13, false);
assertJavaCheckFails(14, false);
assertJavaCheckFails(15, false);
assertJavaCheckFails(16, false);
assertJavaCheckFails(18, false);
assertJavaCheckFails(19, false);
assertJavaCheckFails(20, false);
assertJavaCheckPasses(12, true);
assertJavaCheckPasses(13, true);
assertJavaCheckPasses(14, true);
assertJavaCheckPasses(15, true);
assertJavaCheckPasses(16, true);
assertJavaCheckFails(22, false);
assertJavaCheckPasses(18, true);
assertJavaCheckPasses(19, true);
assertJavaCheckPasses(20, true);
assertJavaCheckPasses(22, true);
}

private static void assertJavaCheckFails(int releaseVersion, boolean enableFutureJava) {
Expand Down