-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Upgrade build toolchain #6432
Upgrade build toolchain #6432
Conversation
@@ -28,7 +28,7 @@ THE SOFTWARE. | |||
<parent> | |||
<groupId>org.jenkins-ci</groupId> | |||
<artifactId>jenkins</artifactId> | |||
<version>1.72</version> | |||
<version>1.73</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulls in a new version of maven-hpi-plugin
.
@@ -85,7 +85,6 @@ THE SOFTWARE. | |||
<patch.tracker.serverId>jenkins-jira</patch.tracker.serverId> | |||
|
|||
<animal.sniffer.skip>${skipTests}</animal.sniffer.skip> | |||
<java.level>8</java.level> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated in the latest parent POM.
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>animal-sniffer-maven-plugin</artifactId> | ||
<configuration> | ||
<signature> | ||
<groupId>org.codehaus.mojo.signature</groupId> | ||
<artifactId>java1${java.level}</artifactId> | ||
<version>1.0</version> | ||
</signature> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>check</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<!-- Version specified in parent POM --> | ||
<configuration> | ||
<source>1.${java.level}</source> | ||
<target>1.${java.level}</target> | ||
<!-- default reuseCreated is more performant | ||
feel free to uncomment if you have any issues on your platform | ||
<compilerReuseStrategy>alwaysNew</compilerReuseStrategy> | ||
--> | ||
</configuration> | ||
</plugin> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was always redundant and declared in the parent POM. Rather than inlining java.level
I thought it best to delete the redundant copypasta.
<And> | ||
<Bug pattern="SSD_DO_NOT_USE_INSTANCE_LOCK_ON_SHARED_STATIC_DATA"/> | ||
<Class name="hudson.model.ViewJob"/> | ||
</And> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some new SpotBugs check that still needs triage. Added to the triage list.
test/pom.xml
Outdated
<!-- | ||
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</jenkins.addOpens> | ||
|
||
<!-- Filled in by maven-hpi-plugin with the path to org-netbeans-insane-hook.jar extracted from jenkins-test-harness --> | ||
<jenkins.insaneHook /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed as defaults for IDEs that don't run Maven.
test/pom.xml
Outdated
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>jenkins-test-harness</artifactId> | ||
<version>1723.vcd938b_e66072</version> | ||
<version>1731.v383b_5d6c3393</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulls in a newer version of INSANE that is needed for Java 17.
<executions> | ||
<execution> | ||
<id>test-runtime</id> | ||
<goals> | ||
<goal>test-runtime</goal> | ||
</goals> | ||
<phase>test</phase> | ||
</execution> | ||
</executions> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sets the jenkins.addOpens
and jenkins.insaneHook
system property. The latter is needed for the newer version of INSANE.
@@ -229,13 +254,32 @@ THE SOFTWARE. | |||
<artifactId>maven-surefire-plugin</artifactId> | |||
<!-- version specified in grandparent pom --> | |||
<configuration> | |||
<argLine>${jacocoSurefireArgs} -Xmx1g @{jenkins.addOpens} @{jenkins.insaneHook}</argLine> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than setting these ourselves in a custom profile, we now rely on maven-hpi-plugin
to set them for us, the same way plugins will in the next release of plugin-pom
.
<executions> | ||
<!-- Unbind the default execution so that it does not run before test-runtime. --> | ||
<execution> | ||
<id>default-test</id> | ||
<goals> | ||
<goal>test</goal> | ||
</goals> | ||
<phase>none</phase> | ||
</execution> | ||
<!-- Bind a new execution which, by virtue of being declared after test-runtime, will also run after it. --> | ||
<execution> | ||
<id>functional-test</id> | ||
<goals> | ||
<goal>test</goal> | ||
</goals> | ||
<phase>test</phase> | ||
</execution> | ||
</executions> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get test-runtime
to run before Surefire. For plugins we define a custom lifecycle, but for the standard lifecycle used in core
we have to define the executions in the order we want them to run in.
VersionNumber javaVersion = new VersionNumber(System.getProperty("java.specification.version")); | ||
if (javaVersion.isOlderThan(new VersionNumber("9")) || javaVersion.isNewerThanOrEqualTo(new VersionNumber("17"))) { // TODO https://github.com/jenkinsci/jenkins-test-harness/issues/359 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not working on Java 11, but this finally works on Java 17.
Proof that this is all working: That is |
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process. Thanks! |
Upgrades the build toolchain to the latest releases of the parent POM, test harness, and Maven HPI plugin. With all of the above,
JenkinsLogRecordsTest
now runs on Java 17.Proposed changelog entries
N/A
Proposed upgrade guidelines
N/A
Submitter checklist
Proposed changelog entries
section only if there are breaking changes or other changes which may require extra steps from users during the upgrade@Restricted
or have@since TODO
Javadoc, as appropriate.Desired reviewers
@mention
Maintainer checklist
Before the changes are marked as
ready-for-merge
:Proposed changelog entries
are accurate, human-readable, and in the imperative moodupgrade-guide-needed
label is set and there is aProposed upgrade guidelines
section in the PR title. (example)lts-candidate
to be considered (see query).