Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 33 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c303a78
Drop support for Java 8
basil Dec 23, 2021
43e1649
Merge remote-tracking branch 'origin/master' into java11
basil Dec 25, 2021
0c778b7
Merge remote-tracking branch 'origin/master' into java11
basil Dec 25, 2021
f74298d
Add TODO comment
basil Dec 25, 2021
c6eae4d
Merge remote-tracking branch 'origin/master' into java11
basil Dec 27, 2021
b5513d8
Merge remote-tracking branch 'origin/master' into java11
basil Dec 29, 2021
b692e12
Merge remote-tracking branch 'origin/master' into java11
basil Jan 2, 2022
6d74bcc
Merge remote-tracking branch 'origin/master' into java11
basil Jan 3, 2022
2a6ee0a
Merge remote-tracking branch 'origin/master' into java11
basil Jan 7, 2022
598fdc9
Merge remote-tracking branch 'origin/master' into java11
basil Jan 21, 2022
8736757
Merge remote-tracking branch 'origin/master' into java11
basil Jan 31, 2022
35d4930
Fix Spotless
basil Jan 31, 2022
139c17f
Merge remote-tracking branch 'origin/master' into java11
basil Apr 15, 2022
2b21238
Merge remote-tracking branch 'origin/master' into java11
basil Apr 20, 2022
2ca44e5
Merge remote-tracking branch 'origin/master' into java11
basil Apr 22, 2022
1a5d528
Merge remote-tracking branch 'origin/master' into java11
basil May 14, 2022
2c05146
Merge remote-tracking branch 'origin/master' into java11
basil May 27, 2022
2cc572b
Merge remote-tracking branch 'origin/master' into java11
basil Jun 6, 2022
d195bfb
Bump Checkstyle
basil Jun 6, 2022
1409081
Merge branch 'master' into java11
timja Jun 19, 2022
74109dd
Merge remote-tracking branch 'origin/master' into java11
basil Jun 22, 2022
1d96882
Update parent POM
basil Jun 22, 2022
a244461
Merge branch 'master' into java11
basil Jun 22, 2022
e9d36a0
Inline relevant portions of pom.xml
basil Jun 22, 2022
2596883
JENKINS-68752 Ignore duplicate log recorder keys (#6673)
timja Jun 22, 2022
bf7ae88
Minify CSS for production releases of Jenkins (#6665)
janfaracik Jun 22, 2022
fee0d26
Improve and simplify SCSS classes and variables (#6667)
janfaracik Jun 22, 2022
42e7873
[JENKINS-68767] feat: Use user-friendly name in uninstaller view (#6666)
NotMyFault Jun 22, 2022
4c135ac
[JEP-230] [JENKINS-55582] Convert `instance-identity` to a detached p…
jglick Jun 22, 2022
3f24e79
Bump spring-framework-bom from 5.3.20 to 5.3.21 (#6664)
dependabot[bot] Jun 22, 2022
a51d145
Simplify
basil Jun 24, 2022
cdc42e8
Merge remote-tracking branch 'origin/master' into java11
basil Jun 24, 2022
7d88c52
https://github.com/jenkinsci/jenkins/pull/6083#discussion_r906199616
basil Jun 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ updates:
# Fails test automation; needs further investigation.
- 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.
- dependency-name: "jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api"

Expand Down
7 changes: 2 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,19 @@ properties([
])

def buildTypes = ['Linux', 'Windows']
def jdks = [8, 11, 17]
def jdks = [11, 17]
basil marked this conversation as resolved.
Show resolved Hide resolved

def builds = [:]
for (i = 0; i < buildTypes.size(); i++) {
for (j = 0; j < jdks.size(); j++) {
def buildType = buildTypes[i]
def jdk = jdks[j]
if (buildType == 'Windows' && jdk == 8) {
continue // unnecessary use of hardware
}
if (buildType == 'Windows' && jdk == 17) {
continue // TODO pending jenkins-infra/helpdesk#2822
}
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
def agentContainerLabel = jdk == 8 ? 'maven' : 'maven-' + jdk
def agentContainerLabel = 'maven-' + jdk
if (buildType == 'Windows') {
agentContainerLabel += '-windows'
}
Expand Down
20 changes: 2 additions & 18 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ THE SOFTWARE.
<artifactId>maven-surefire-plugin</artifactId>
<!-- Version specified in grandparent POM -->
<configuration>
<argLine>@{jacocoSurefireArgs}</argLine>
<!-- Make sure to keep the directives in test/pom.xml and war/pom.xml in sync with these. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just seems to be shuffled around from a profile, but while we are here and since it is related to Java 11: would it be possible to introduce a POM property in root pom.xml to enforce that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The versions in core/pom.xml and test/pom.xml could be deduplicated but the version in war/pom.xml cannot be deduplicated because it is in the form of a MANIFEST.MF directive rather than command-line arguments. I am not sure the savings of 3 to 2 copies of the code is worth it.

<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>
<reuseForks>false</reuseForks>
</configuration>
Expand Down Expand Up @@ -821,23 +822,6 @@ THE SOFTWARE.
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
</properties>
</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>
<id>enable-jacoco</id>
<build>
Expand Down
5 changes: 2 additions & 3 deletions core/src/main/java/hudson/model/UpdateCenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
import net.sf.json.JSONObject;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.input.CountingInputStream;
import org.apache.commons.io.output.NullOutputStream;
import org.jenkinsci.Symbol;
import org.jvnet.localizer.Localizable;
import org.kohsuke.accmod.Restricted;
Expand Down Expand Up @@ -1422,8 +1421,8 @@ private void testConnection(URL url) throws IOException {
throw new HttpRetryException("Invalid response code (" + responseCode + ") from URL: " + url, responseCode);
}
} else {
try (InputStream is = connection.getInputStream()) {
IOUtils.copy(is, NullOutputStream.NULL_OUTPUT_STREAM);
try (InputStream is = connection.getInputStream(); OutputStream os = OutputStream.nullOutputStream()) {
IOUtils.copy(is, os);
}
}
} catch (SSLHandshakeException e) {
Expand Down
34 changes: 3 additions & 31 deletions 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.76</version>
<version>1.77</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -85,8 +85,6 @@ THE SOFTWARE.
<project.patchManagement.url>https://api.github.com</project.patchManagement.url>
<patch.tracker.serverId>jenkins-jira</patch.tracker.serverId>

<animal.sniffer.skip>${skipTests}</animal.sniffer.skip>

<changelog.url>https://www.jenkins.io/changelog</changelog.url>

<!-- Bundled Remoting version -->
Expand Down Expand Up @@ -380,10 +378,6 @@ THE SOFTWARE.
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
Expand All @@ -406,7 +400,7 @@ THE SOFTWARE.
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>9.3</version>
<version>10.3</version>
</dependency>
</dependencies>
<executions>
Expand Down Expand Up @@ -471,7 +465,7 @@ THE SOFTWARE.
<arguments>-P release,sign</arguments>
<!-- work around for a bug in javadoc plugin that causes the release to fail. see MRELEASE-271 -->
<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>
<localCheckout>true</localCheckout>
<tagNameFormat>jenkins-@{project.version}</tagNameFormat>
Expand Down Expand Up @@ -647,27 +641,5 @@ THE SOFTWARE.
<failIfNoTests>false</failIfNoTests>
</properties>
</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>
</project>
5 changes: 4 additions & 1 deletion src/spotbugs/spotbugs-excludes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,10 @@
</And>
<And>
<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>
<Bug pattern="STATIC_IV"/>
Expand Down
30 changes: 5 additions & 25 deletions test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ THE SOFTWARE.
<mavenDebug>false</mavenDebug>
<!-- Filled in by jacoco-maven-plugin -->
<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 -->
<jenkins.insaneHook />
</properties>
Expand Down Expand Up @@ -367,30 +372,5 @@ THE SOFTWARE.
</plugins>
</build>
</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>
</project>