mirror of
https://github.com/jenkinsci/jenkins.git
synced 2024-10-23 08:45:06 +08:00
Require Java 17 or newer (#9358)
This commit is contained in:
parent
d4e970faee
commit
75f6c56c77
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
@ -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()
|
||||
|
||||
/*
|
||||
|
@ -78,16 +78,6 @@ public class JavaVersionRecommendationAdminMonitor extends AdministrativeMonitor
|
||||
|
||||
static {
|
||||
NavigableMap<Integer, LocalDate> supportedVersions = new TreeMap<>();
|
||||
// Adjust Java 11 end of life date for weekly and 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
|
||||
SUPPORTED_JAVA_VERSIONS = Collections.unmodifiableNavigableMap(supportedVersions);
|
||||
|
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
||||
|
45
war/pom.xml
45
war/pom.xml
@ -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 -->
|
||||
|
@ -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.
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user