-
Notifications
You must be signed in to change notification settings - Fork 51
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
Require Jenkins 2.479.1 or newer #134
Merged
damianszczepanik
merged 5 commits into
jenkinsci:master
from
MarkEWaite:require-2.479.1-and-java-17
Jan 19, 2025
Merged
Require Jenkins 2.479.1 or newer #134
damianszczepanik
merged 5 commits into
jenkinsci:master
from
MarkEWaite:require-2.479.1-and-java-17
Jan 19, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bumps [org.jenkins-ci.plugins:plugin](https://github.com/jenkinsci/plugin-pom) from 4.88 to 5.5. - [Release notes](https://github.com/jenkinsci/plugin-pom/releases) - [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md) - [Commits](jenkinsci/plugin-pom@plugin-4.88...plugin-5.5) --- updated-dependencies: - dependency-name: org.jenkins-ci.plugins:plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Use the most recent plugin BOM 3944.v1a_e4f8b_452db_ Allows the use of Java 17 features in the plugin source code.
The Java 17 pattern matching instanceof makes it easier to read the code because it defines the new variable as part of the instanceof and performs the cast without requiring a separate statement for the cast. https://docs.oracle.com/en/java/javase/17/language/pattern-matching-instanceof.html provides more details on the technique.
Java 17 adds text blocks as part of https://openjdk.org/jeps/378 Included in that change, strings now have a formatted method that is the same as the String.format() static method. The OpenRewrite migrator for Java 17 suggests replacing String.format() with str.format().
damianszczepanik
approved these changes
Jan 19, 2025
@damianszczepanik Could this please be released? That would get us one step closer to being able to migrate off the compatibility layer in Jenkins core. |
Plugin has been published |
Thank you very much! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Require Jenkins 2.479.1 or newer
Use the most recent plugin BOM 3944.v1a_e4f8b_452db_ and require Jenkins 2.479.1 so that Jakarta EE 9 is used and Java 17 features can be used in the plugin source code.
The developer guide notes that 2.479.1 should be considered if there are specific reasons to want something newer. In this case, we want to reduce the use of the Java EE 8 and Spring Security 5 compatibility layer that was introduced in Jenkins 2.479.1 so that we can eventually remove most of the compatibility layer. We also want to allow use of Java 17 language features.
Java 17 language features used in this pull request include:
The Java 17 pattern matching instanceof makes it easier to read the code because it defines the new variable as part of the instanceof and performs the cast without requiring a separate statement for the cast.
An Oracle article provides more details on the technique.
Java 17 adds text blocks as part of JEP-378.
Included in that change, strings now have a formatted method that is the same as the String.format() static method. The OpenRewrite migrator for Java 17 suggests replacing String.format() with str.format().
Special thanks to OpenRewrite and Moderne for the Java 17 migration automation.
Supersedes pull request:
Testing done
Confirmed that automated tests pass with Java 21 on Linux. Rely on ci.jenkins.io to confirm that automated tests pass with Java 17 on Windows.
Submitter checklist