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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump jenkins from 1.76 to 1.77 #444

Merged
merged 8 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ buildPlugin(useContainerAgent: true, configurations: [
[ platform: 'linux', jdk: '8' ],
[ platform: 'linux', jdk: '11' ],
[ platform: 'windows', jdk: '11' ],
[ platform: 'linux', jdk: '17', jenkins: '2.354' ],
[ platform: 'linux', jdk: '17', jenkins: '2.356' ],
basil marked this conversation as resolved.
Show resolved Hide resolved
])
105 changes: 104 additions & 1 deletion 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 @@ -217,6 +217,25 @@ THE SOFTWARE.
</pluginRepositories>
<build>
<plugins>
<!-- TODO When the minimum Jenkins baseline is bumped past 2.357, this can be deleted. -->
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>display-info</id>
<configuration>
<rules>
<requireJavaVersion>
<version>[1.8.0,]</version>
</requireJavaVersion>
<enforceBytecodeVersion>
<maxJdkVersion>1.8</maxJdkVersion>
</enforceBytecodeVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
Expand Down Expand Up @@ -321,13 +340,33 @@ THE SOFTWARE.
<profiles>
<profile>
<id>jdk-9-and-above</id>
<!-- TODO When the minimum Jenkins baseline is bumped past 2.357, this can be lifted out of the profile. -->
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<jenkins.insaneHook>--patch-module=java.base=${project.build.outputDirectory}/netbeans/harness/modules/ext/org-netbeans-insane-hook.jar --add-exports=java.base/org.netbeans.insane.hook=ALL-UNNAMED</jenkins.insaneHook>
</properties>
<!-- TODO When the minimum Jenkins baseline is bumped past 2.357, this can be deleted. -->
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>8</release>
<testRelease>8</testRelease>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<release>8</release>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- TODO When the minimum Jenkins baseline is bumped past 2.357, this can be deleted. -->
<profile>
<id>jdk-8-and-below</id>
<activation>
Expand All @@ -336,6 +375,28 @@ THE SOFTWARE.
<properties>
<jenkins.insaneHook>-Xbootclasspath/p:${project.build.outputDirectory}/netbeans/harness/modules/ext/org-netbeans-insane-hook.jar</jenkins.insaneHook>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<testSource>1.8</testSource>
<testTarget>1.8</testTarget>
<release combine.self="override" />
<testRelease combine.self="override" />
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<source>1.8</source>
<release combine.self="override" />
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>skip-tests-on-release</id>
Expand Down Expand Up @@ -385,6 +446,48 @@ THE SOFTWARE.
</plugins>
</build>
</profile>
<!--
Our Jenkinsfile has a Java 17 branch that tests a recent weekly release for two reasons:

1. We want to test on all versions of Java, but only recent weeklies support Java 17.

2. Testing against a recent weekly release ensures that the test harness can be compiled
against the latest core APIs.

When we are testing against a recent weekly that requires Java 11, the bytecode version
check naturally fails. To work around this, we relax the bytecode version check
when we are executing the Java 17 branch in the CI environment.

TODO When the minimum Jenkins baseline is bumped past 2.357, this can be deleted.
-->
<profile>
<id>test-recent-cores-on-ci</id>
<activation>
<jdk>17</jdk>
<property>
<name>env.CI</name>
</property>
Comment on lines +458 to +469
Copy link
Member

Choose a reason for hiding this comment

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

Or just

Suggested change
check naturally fails. To work around this, we relax the bytecode version check
when we are executing the Java 17 branch in the CI environment.
TODO When the minimum Jenkins baseline is bumped past 2.357, this can be deleted.
-->
<profile>
<id>test-recent-cores-on-ci</id>
<activation>
<jdk>17</jdk>
<property>
<name>env.CI</name>
</property>
check naturally fails. To work around this, we relax the bytecode version check
when we are executing the Java 17 branch.
TODO When the minimum Jenkins baseline is bumped past 2.357, this can be deleted.
-->
<profile>
<id>test-recent-cores-on-ci</id>
<activation>
<jdk>17</jdk>

to simplify?

Copy link
Member

Choose a reason for hiding this comment

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

But then someone who happens to be running locally with Java 17 but has not customized the Jenkins version would get the looser Enforcer semantics of 11 and may accidentally depend on a Java 11 API. The CI build would catch this before it is merged and released, but I think local and CI builds should be as close as possible. I like restricting this to CI builds since that is the only place where we are programmatically using a recent weekly version.

Copy link
Member

Choose a reason for hiding this comment

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

local and CI builds should be as close as possible

Well of course that was my point as well, from another perspective. 馃榿 Anyway, this is fine.

Copy link
Member

Choose a reason for hiding this comment

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

Right, someone who is running locally with jenkins.version would need to set CI=true to get this logic. I dunno if there is a good solution here. Really what I need is a way to activate the profile if the version number is greater than or equal to some value, but I can't think of a way to do that with Maven profile activation.

Copy link
Member

Choose a reason for hiding this comment

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

activate the profile if the version number is greater than or equal to some value

Yeah that is moving into Gradle territory I think.

</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>display-info</id>
<configuration>
<rules>
<enforceBytecodeVersion>
<maxJdkVersion>11</maxJdkVersion>
</enforceBytecodeVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>