[JEP-236] [JENKINS-68570] Require Java 11 or newer (#6083)

This commit is contained in:
Basil Crow 2022-06-24 09:56:33 -07:00 committed by GitHub
parent 6b5c21debd
commit c60ea9210c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 87 deletions

View File

@ -34,10 +34,6 @@ updates:
# Fails test automation; needs further investigation. # Fails test automation; needs further investigation.
- dependency-name: "com.google.inject:guice-bom" - dependency-name: "com.google.inject:guice-bom"
# Requires Java 11 starting with version 10.0.
- dependency-name: "com.puppycrawl.tools:checkstyle"
versions: [">=10.0"]
# Contains incompatible API changes and needs compatibility work. # Contains incompatible API changes and needs compatibility work.
- dependency-name: "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api" - dependency-name: "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api"

7
Jenkinsfile vendored
View File

@ -13,22 +13,19 @@ properties([
]) ])
def buildTypes = ['Linux', 'Windows'] def buildTypes = ['Linux', 'Windows']
def jdks = [8, 11, 17] def jdks = [11, 17]
def builds = [:] def builds = [:]
for (i = 0; i < buildTypes.size(); i++) { for (i = 0; i < buildTypes.size(); i++) {
for (j = 0; j < jdks.size(); j++) { for (j = 0; j < jdks.size(); j++) {
def buildType = buildTypes[i] def buildType = buildTypes[i]
def jdk = jdks[j] def jdk = jdks[j]
if (buildType == 'Windows' && jdk == 8) {
continue // unnecessary use of hardware
}
if (buildType == 'Windows' && jdk == 17) { if (buildType == 'Windows' && jdk == 17) {
continue // TODO pending jenkins-infra/helpdesk#2822 continue // TODO pending jenkins-infra/helpdesk#2822
} }
builds["${buildType}-jdk${jdk}"] = { builds["${buildType}-jdk${jdk}"] = {
// see https://github.com/jenkins-infra/documentation/blob/master/ci.adoc#node-labels for information on what node types are available // see https://github.com/jenkins-infra/documentation/blob/master/ci.adoc#node-labels for information on what node types are available
def agentContainerLabel = jdk == 8 ? 'maven' : 'maven-' + jdk def agentContainerLabel = 'maven-' + jdk
if (buildType == 'Windows') { if (buildType == 'Windows') {
agentContainerLabel += '-windows' agentContainerLabel += '-windows'
} }

View File

@ -719,7 +719,8 @@ THE SOFTWARE.
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<!-- Version specified in grandparent POM --> <!-- Version specified in grandparent POM -->
<configuration> <configuration>
<argLine>@{jacocoSurefireArgs}</argLine> <!-- Make sure to keep the directives in test/pom.xml and war/pom.xml in sync with these. -->
<argLine>@{jacocoSurefireArgs} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.desktop/com.sun.beans.introspect=ALL-UNNAMED</argLine>
<forkCount>0.5C</forkCount> <forkCount>0.5C</forkCount>
<reuseForks>false</reuseForks> <reuseForks>false</reuseForks>
</configuration> </configuration>
@ -821,23 +822,6 @@ THE SOFTWARE.
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
</properties> </properties>
</profile> </profile>
<profile>
<id>jdk-9-and-above</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Make sure to keep the directives in test/pom.xml and war/pom.xml in sync with these. -->
<argLine>@{jacocoSurefireArgs} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.desktop/com.sun.beans.introspect=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile> <profile>
<id>enable-jacoco</id> <id>enable-jacoco</id>
<build> <build>

View File

@ -114,7 +114,6 @@ import jenkins.util.io.OnMaster;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.io.input.CountingInputStream; import org.apache.commons.io.input.CountingInputStream;
import org.apache.commons.io.output.NullOutputStream;
import org.jenkinsci.Symbol; import org.jenkinsci.Symbol;
import org.jvnet.localizer.Localizable; import org.jvnet.localizer.Localizable;
import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.Restricted;
@ -1422,8 +1421,8 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
throw new HttpRetryException("Invalid response code (" + responseCode + ") from URL: " + url, responseCode); throw new HttpRetryException("Invalid response code (" + responseCode + ") from URL: " + url, responseCode);
} }
} else { } else {
try (InputStream is = connection.getInputStream()) { try (InputStream is = connection.getInputStream(); OutputStream os = OutputStream.nullOutputStream()) {
IOUtils.copy(is, NullOutputStream.NULL_OUTPUT_STREAM); IOUtils.copy(is, os);
} }
} }
} catch (SSLHandshakeException e) { } catch (SSLHandshakeException e) {

34
pom.xml
View File

@ -28,7 +28,7 @@ THE SOFTWARE.
<parent> <parent>
<groupId>org.jenkins-ci</groupId> <groupId>org.jenkins-ci</groupId>
<artifactId>jenkins</artifactId> <artifactId>jenkins</artifactId>
<version>1.76</version> <version>1.77</version>
<relativePath /> <relativePath />
</parent> </parent>
@ -85,8 +85,6 @@ THE SOFTWARE.
<project.patchManagement.url>https://api.github.com</project.patchManagement.url> <project.patchManagement.url>https://api.github.com</project.patchManagement.url>
<patch.tracker.serverId>jenkins-jira</patch.tracker.serverId> <patch.tracker.serverId>jenkins-jira</patch.tracker.serverId>
<animal.sniffer.skip>${skipTests}</animal.sniffer.skip>
<changelog.url>https://www.jenkins.io/changelog</changelog.url> <changelog.url>https://www.jenkins.io/changelog</changelog.url>
<!-- Bundled Remoting version --> <!-- Bundled Remoting version -->
@ -380,10 +378,6 @@ THE SOFTWARE.
</lifecycleMappingMetadata> </lifecycleMappingMetadata>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
</plugin>
<plugin> <plugin>
<groupId>com.github.spotbugs</groupId> <groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId> <artifactId>spotbugs-maven-plugin</artifactId>
@ -406,7 +400,7 @@ THE SOFTWARE.
<dependency> <dependency>
<groupId>com.puppycrawl.tools</groupId> <groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId> <artifactId>checkstyle</artifactId>
<version>9.3</version> <version>10.3</version>
</dependency> </dependency>
</dependencies> </dependencies>
<executions> <executions>
@ -471,7 +465,7 @@ THE SOFTWARE.
<arguments>-P release,sign</arguments> <arguments>-P release,sign</arguments>
<!-- work around for a bug in javadoc plugin that causes the release to fail. see MRELEASE-271 --> <!-- work around for a bug in javadoc plugin that causes the release to fail. see MRELEASE-271 -->
<preparationGoals>clean install</preparationGoals> <preparationGoals>clean install</preparationGoals>
<goals>-DskipTests -Danimal.sniffer.skip=false -Dspotbugs.skip -Dmaven.checkstyle.skip -Dspotless.check.skip generate-resources javadoc:javadoc deploy</goals> <goals>-DskipTests -Dspotbugs.skip -Dmaven.checkstyle.skip -Dspotless.check.skip generate-resources javadoc:javadoc deploy</goals>
<pushChanges>false</pushChanges> <pushChanges>false</pushChanges>
<localCheckout>true</localCheckout> <localCheckout>true</localCheckout>
<tagNameFormat>jenkins-@{project.version}</tagNameFormat> <tagNameFormat>jenkins-@{project.version}</tagNameFormat>
@ -647,27 +641,5 @@ THE SOFTWARE.
<failIfNoTests>false</failIfNoTests> <failIfNoTests>false</failIfNoTests>
</properties> </properties>
</profile> </profile>
<profile>
<id>jdk-17-and-above</id>
<activation>
<jdk>[17,)</jdk>
</activation>
<properties>
<!--
Animal Sniffer does not work on Java 17, but we cannot remove it from our configuration
entirely until we drop support for Java 8. As a temporary solution, we skip it when
running on Java 17. When JENKINS-54842 is resolved, this can be deleted.
-->
<animal.sniffer.skip>true</animal.sniffer.skip>
<!--
Spotless requires custom arguments to be added to .mvn/jvm.config when running on Java 17,
but we cannot add those custom arguments until we drop support for Java 8. As a temporary
workaround, we skip Spotless when running on Java 17. When JENKINS-68015 is resolved, this
can be deleted.
-->
<spotless.check.skip>true</spotless.check.skip>
</properties>
</profile>
</profiles> </profiles>
</project> </project>

View File

@ -563,7 +563,10 @@
</And> </And>
<And> <And>
<Bug pattern="SSD_DO_NOT_USE_INSTANCE_LOCK_ON_SHARED_STATIC_DATA"/> <Bug pattern="SSD_DO_NOT_USE_INSTANCE_LOCK_ON_SHARED_STATIC_DATA"/>
<Class name="hudson.model.ViewJob"/> <Or>
<Class name="hudson.model.ViewJob"/>
<Class name="hudson.TcpSlaveAgentListener$ConnectionHandler"/>
</Or>
</And> </And>
<And> <And>
<Bug pattern="STATIC_IV"/> <Bug pattern="STATIC_IV"/>

View File

@ -42,6 +42,11 @@ THE SOFTWARE.
<mavenDebug>false</mavenDebug> <mavenDebug>false</mavenDebug>
<!-- Filled in by jacoco-maven-plugin --> <!-- Filled in by jacoco-maven-plugin -->
<jacocoSurefireArgs /> <jacocoSurefireArgs />
<!--
Filled in by maven-hpi-plugin from the MANIFEST.MF entry in jenkins.war, but we provide a default value for the benefit of IDEs.
Make sure to keep the directives in core/pom.xml and war/pom.xml in sync with these.
-->
<jenkins.addOpens>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.desktop/com.sun.beans.introspect=ALL-UNNAMED</jenkins.addOpens>
<!-- Filled in by maven-hpi-plugin with the path to org-netbeans-insane-hook.jar extracted from jenkins-test-harness --> <!-- Filled in by maven-hpi-plugin with the path to org-netbeans-insane-hook.jar extracted from jenkins-test-harness -->
<jenkins.insaneHook /> <jenkins.insaneHook />
</properties> </properties>
@ -367,30 +372,5 @@ THE SOFTWARE.
</plugins> </plugins>
</build> </build>
</profile> </profile>
<profile>
<id>jdk-8-and-below</id>
<activation>
<jdk>(,1.8]</jdk>
</activation>
<properties>
<!--
Filled in by maven-hpi-plugin from the MANIFEST.MF entry in jenkins.war, but we provide a default value for the benefit of IDEs.
-->
<jenkins.addOpens />
</properties>
</profile>
<profile>
<id>jdk-9-and-above</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<!--
Filled in by maven-hpi-plugin from the MANIFEST.MF entry in jenkins.war, but we provide a default value for the benefit of IDEs.
Make sure to keep the directives in core/pom.xml and war/pom.xml in sync with these.
-->
<jenkins.addOpens>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.desktop/com.sun.beans.introspect=ALL-UNNAMED</jenkins.addOpens>
</properties>
</profile>
</profiles> </profiles>
</project> </project>