Skip to content

Commit 7babab1

Browse files
committed
Require Java 21 or newer
As Java 25 is available for a couple of months now, it is time to drop support for Java 17. Starting with this commit, Jenkins supports only Java 21 and 25, or newer. See https://www.jenkins.io/blog/2023/11/06/introducing-2-2-2-java-support-plan/.
1 parent be95267 commit 7babab1

File tree

4 files changed

+14
-49
lines changed

4 files changed

+14
-49
lines changed

core/src/main/java/jenkins/monitor/JavaVersionRecommendationAdminMonitor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public class JavaVersionRecommendationAdminMonitor extends AdministrativeMonitor
7878

7979
static {
8080
NavigableMap<Integer, LocalDate> supportedVersions = new TreeMap<>();
81-
supportedVersions.put(17, LocalDate.of(2026, 3, 31)); // Temurin: 2027-10-31
8281
supportedVersions.put(21, LocalDate.of(2027, 9, 30)); // Temurin: 2029-09-30
8382
supportedVersions.put(25, LocalDate.of(2029, 9, 30)); // Temurin: 2031-09-30
8483
SUPPORTED_JAVA_VERSIONS = Collections.unmodifiableNavigableMap(supportedVersions);

war/pom.xml

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ THE SOFTWARE.
133133
<build>
134134
<finalName>jenkins</finalName>
135135
<plugins>
136-
<!-- TODO When Java 11 usage declines to a terminal level, this can be deleted. -->
137136
<plugin>
138137
<groupId>org.apache.maven.plugins</groupId>
139138
<artifactId>maven-enforcer-plugin</artifactId>
@@ -143,43 +142,10 @@ THE SOFTWARE.
143142
<configuration>
144143
<rules>
145144
<requireJavaVersion>
146-
<version>11</version>
145+
<version>21</version>
147146
</requireJavaVersion>
148147
<enforceBytecodeVersion>
149-
<maxJdkVersion>11</maxJdkVersion>
150-
<excludes>
151-
<exclude>io.jenkins.tools:bridge-method-annotation</exclude>
152-
<exclude>org.jenkins-ci:annotation-indexer</exclude>
153-
<exclude>org.jenkins-ci:commons-jelly</exclude>
154-
<exclude>org.jenkins-ci:commons-jelly-tags-fmt</exclude>
155-
<exclude>org.jenkins-ci:commons-jelly-tags-xml</exclude>
156-
<exclude>org.jenkins-ci:crypto-util</exclude>
157-
<exclude>org.jenkins-ci.main:cli</exclude>
158-
<exclude>org.jenkins-ci.main:jenkins-core</exclude>
159-
<exclude>org.jenkins-ci.main:remoting</exclude>
160-
<exclude>org.jenkins-ci.main:websocket-jetty12-ee9</exclude>
161-
<exclude>org.jenkins-ci.main:websocket-spi</exclude>
162-
<exclude>org.jenkins-ci:memory-monitor</exclude>
163-
<exclude>org.jenkins-ci:symbol-annotation</exclude>
164-
<exclude>org.jenkins-ci:task-reactor</exclude>
165-
<exclude>org.jenkins-ci:version-number</exclude>
166-
<exclude>org.jvnet.hudson:commons-jelly-tags-define</exclude>
167-
<exclude>org.jvnet.winp:winp</exclude>
168-
<exclude>org.kohsuke:access-modifier-annotation</exclude>
169-
<exclude>org.kohsuke.stapler:json-lib</exclude>
170-
<exclude>org.kohsuke.stapler:stapler</exclude>
171-
<exclude>org.kohsuke.stapler:stapler-groovy</exclude>
172-
<exclude>org.kohsuke.stapler:stapler-jelly</exclude>
173-
<exclude>org.springframework.security:spring-security-core</exclude>
174-
<exclude>org.springframework.security:spring-security-crypto</exclude>
175-
<exclude>org.springframework.security:spring-security-web</exclude>
176-
<exclude>org.springframework:spring-aop</exclude>
177-
<exclude>org.springframework:spring-beans</exclude>
178-
<exclude>org.springframework:spring-context</exclude>
179-
<exclude>org.springframework:spring-core</exclude>
180-
<exclude>org.springframework:spring-expression</exclude>
181-
<exclude>org.springframework:spring-web</exclude>
182-
</excludes>
148+
<maxJdkVersion>21</maxJdkVersion>
183149
</enforceBytecodeVersion>
184150
</rules>
185151
</configuration>
@@ -190,15 +156,15 @@ THE SOFTWARE.
190156
<groupId>org.apache.maven.plugins</groupId>
191157
<artifactId>maven-compiler-plugin</artifactId>
192158
<configuration>
193-
<release>11</release>
194-
<testRelease>11</testRelease>
159+
<release>21</release>
160+
<testRelease>21</testRelease>
195161
</configuration>
196162
</plugin>
197163
<plugin>
198164
<groupId>org.apache.maven.plugins</groupId>
199165
<artifactId>maven-javadoc-plugin</artifactId>
200166
<configuration>
201-
<release>11</release>
167+
<release>21</release>
202168
</configuration>
203169
</plugin>
204170
<plugin>

war/src/main/java/executable/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class Main {
7676
* This list must remain synchronized with the one in {@code
7777
* JavaVersionRecommendationAdminMonitor}.
7878
*/
79-
private static final NavigableSet<Integer> SUPPORTED_JAVA_VERSIONS = new TreeSet<>(List.of(17, 21, 25));
79+
private static final NavigableSet<Integer> SUPPORTED_JAVA_VERSIONS = new TreeSet<>(List.of(21, 25));
8080

8181
/**
8282
* Sets custom session cookie name.

war/src/test/java/executable/MainTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ void unsupported() {
1313
assertJavaCheckFails(8, true);
1414
assertJavaCheckFails(11, false);
1515
assertJavaCheckFails(11, true);
16+
assertJavaCheckFails(17, false);
17+
assertJavaCheckFails(17, true);
1618
}
1719

1820
@Test
1921
void supported() {
20-
assertJavaCheckPasses(17, false);
21-
assertJavaCheckPasses(17, true);
2222
assertJavaCheckPasses(21, false);
2323
assertJavaCheckPasses(21, true);
24+
assertJavaCheckPasses(25, false);
25+
assertJavaCheckPasses(25, true);
2426
}
2527

2628
@Test
2729
void future() {
28-
assertJavaCheckFails(18, false);
29-
assertJavaCheckFails(19, false);
30-
assertJavaCheckFails(20, false);
3130
assertJavaCheckFails(22, false);
32-
assertJavaCheckPasses(18, true);
33-
assertJavaCheckPasses(19, true);
34-
assertJavaCheckPasses(20, true);
31+
assertJavaCheckFails(23, false);
32+
assertJavaCheckFails(24, false);
3533
assertJavaCheckPasses(22, true);
34+
assertJavaCheckPasses(23, true);
35+
assertJavaCheckPasses(24, true);
3636
}
3737

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

0 commit comments

Comments
 (0)