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

Require Java 11 and Jenkins 2.361.4 or newer #126

Merged

Conversation

MarkEWaite
Copy link

@MarkEWaite MarkEWaite commented Oct 23, 2023

Require Java 11 and Jenkins 2.361.4 or newer

Jenkins core has required Java 11 for over a year. As part of preparing for Java 21 support, I updated this plugin to require Java 11 and to use Jenkins 2.361.4 or newer as its minimum version.

Not ready for Java 17 or Java 21 because gmaven is used to compile groovy source files and that seems to no longer be recommended practice by the gmaven plugin maintainers.

Changes in this pull request are necessary but not sufficient for modernization of this plugin.

Based on the work in the pull requests:

Other changes that were made included:

  • Update project configuration
  • Upgrade project to latest Jenkins version
  • Remove assertions that depend on undeclared parameters
  • Require Java 11 and Jenkins 2.361.4 or newer
  • Use parent pom 4.74
  • Use parent pom spotbugs, not outdated findbugs
  • Remove dead local store
  • Add more spotbugs exclusions
  • Declare a string as final to satisfy checkstyle
  • Use https:// instead of git:// in scm property
  • Resolve checkstyle complaints in FormValidations
  • Use checkstyle 3.3.0
  • Exclude generated sources from checkstyle checks
  • Silence checkstyle warning about space
  • Add javadoc to satisfy checkstyle
  • Declare some strings final to satisfy checkstyle
  • Wrap the line to satisfy checkstyle
  • Remove pmd - not helpful
  • Do not test with Java 17

Testing done

Confirmed that tests pass with Java 11 on Linux and that warnings are silenced from mvn clean verify.

Confirmed that interactive use with Jenkins 2.414.3 is no worse than it was before this pull request. Images are now displayed correctly in the view provided by this plugin.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes

alecharp and others added 19 commits October 14, 2022 21:15
This is required to be able to work on modern core version of Jenkins.
Several changes have been made to the Jenkins ecosystem since this project was built.
Adapt several of the calls to the latest call signatures:
 * Selenium WebDriver now takes Duration instead of seconds / int + unit
 * The Messages class is now internal-only inside Jenkins.
 * Converted BuildPipelineDashboardTest to Java to avoid duplicate class error when building groovy
 * Matrix-auth is now a plugin
 * Spock needs to target the right Groovy version, now 2.4.
 * Use parent-pom specified surefire (now 3.0)
 * Specify "escape-by-default" jelly configuration
Jenkins has removed the ability to pass undeclared parameters as part
of a security fix.  These two assertions rely on that security hole.
Remove them.
Remove two dependency declarations that are now provided by the parent
pom.

Update the plugin bill of materials to match the minimum required
Jenkins version.

Declare the objenesis version because it is no longer provided by the
parent pom.
Fix a spotbugs warning without changing code behavior
Prevent future spotbugs messages from being introduced, without
resolving the existing issues.
The checkstyle complaints are not very helpful, but it is easier to
resolve the complaints than to declare some form of exception to the
complaints.
Compilation fails with Java 17
@MarkEWaite MarkEWaite mentioned this pull request Oct 23, 2023
6 tasks
@yoavain-sundaysky
Copy link

yoavain-sundaysky commented Oct 25, 2023

This is amazing!

I took your branch and added a fix to all icons (the PR you mentioned did not fix everything).
If you want to add the icon fix to your PR, I'm attaching a zip with a patch file and the modified files

changed-files-and-patch.zip

@MarkEWaite

This comment was marked as outdated.

Submitted as a patch to my pull request
@MarkEWaite
Copy link
Author

The plugin build was successful and the icons display correctly thanks to @yoavain-sundaysky

build-pipeline-plugin.zip

@MarkEWaite
Copy link
Author

@dalvizu , @recena , or @geoffbullen would you be willing to merge this? The plugin is popular enough that I believe it should eventually be tested with Java 21. That's not this pull request, but might arrive in a future pull request.

@dalvizu
Copy link
Member

dalvizu commented Nov 13, 2023

I'll review and merge this by Friday. I can't be an effective maintainer of this plugin going forward, is there an area to list a plugin as open for adoption?

@MarkEWaite
Copy link
Author

I'll review and merge this by Friday. I can't be an effective maintainer of this plugin going forward, is there an area to list a plugin as open for adoption?

Thanks for asking. There is a place to announce that the plugin is up for adoption. If you add the "adopt-this-plugin" topic to the GitHub repository, that will make it visible to others that it is up for adoption. You can see an example with the jaxb plugin. As an added step, you could also announce that it is up for adoption on the Jenkins developer mailing list.

@dalvizu dalvizu merged commit 5d1f25d into jenkinsci:master Nov 19, 2023
@MarkEWaite MarkEWaite deleted the require-java-11-and-jenkins-2.361.4 branch November 19, 2023 19:46
@dalvizu
Copy link
Member

dalvizu commented Nov 20, 2023

Released in 2.0.0

Comment on lines +7 to +8
// Compilation fails on Java 17
// [ platform: 'linux', jdk: '17' ],
Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants