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

feat: Support Jenkins >= 2.475 #235

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

rahulsom
Copy link

@rahulsom rahulsom commented Jan 8, 2025

Jenkins 2.475 and Jenkins LTS 2.479.1 introduce a change to the Java Servlet API version and the servlet container support policy.

This takes it from JEE8 to JEE9.
This changes the coordinates of servlet-api to jakarta.

This gradle plugin can be built with JDK 11 but not with JDK 17 which would be required for adding the extra test to JenkinsVersionIntegrationSpec.

Related: JENKINS-73278
Related: jenkinsci/jenkins#9672

Testing done

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
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Jenkins 2.475 and Jenkins LTS 2.479.1 introduce a change to the Java Servlet API version and the servlet container support policy.

This takes it from JEE8 to JEE9.
This changes the coordinates of servlet-api to jakarta.

This gradle plugin can be built with JDK 11 but not with JDK 17 which would be required for adding the extra test to `JenkinsVersionIntegrationSpec`.

Related: JENKINS-73278
Copy link

@sghill sghill left a comment

Choose a reason for hiding this comment

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

Thanks!

@sghill sghill merged commit 7387a74 into jenkinsci:master Jan 14, 2025
14 checks passed
@basil
Copy link
Member

basil commented Feb 13, 2025

Looking at 7387a74 it seems this was released in v0.53.0-rc.2 and
v0.52.0-rc.3 but not 0.52.0 itself? Can this please be released in a non-release candidate build so I can consume it from gradle-plugin?

@sghill
Copy link

sghill commented Feb 13, 2025

@basil 0.53.0 is out now. Releases page will be updated later today.

A tooling issue led to 0.52.0-rc.3 being created after 0.52.0 was already released. This has since been fixed.

@basil
Copy link
Member

basil commented Feb 15, 2025

@rahulsom This PR appears to be necessary but not sufficient to support Jenkins ≥ 2.475 and Java 17, as demonstrated in the minimal conversion in jenkinsci/text-finder-plugin#256 which fails test compilation with

> Compilation failed; see the compiler output below.
  /home/jenkins/agent/workspace/lugins_text-finder-plugin_PR-256/src/test/java/hudson/plugins/textfinder/test/TestWriteFileBuilder.java:41: error: cannot access ServletException
      public static class DescriptorImpl extends BuildStepDescriptor<Builder> {
                    ^
    class file for jakarta.servlet.ServletException not found
  Note: Some input files use or override a deprecated API.
  Note: Recompile with -Xlint:deprecation for details.
  1 error

@rahulsom
Copy link
Author

I checked out that branch and ran this

./gradlew dependencyInsight --configuration compileClasspath --dependency servlet-api

It does show

jakarta.servlet:jakarta.servlet-api:5.0.0
+--- compileClasspath
\--- org.jenkins-ci.main:jenkins-bom:2.479.1
     +--- compileClasspath
     \--- org.jenkins-ci.main:jenkins-core:2.479.1
          \--- compileClasspath

But this doesn't

./gradlew dependencyInsight --configuration testCompileClasspath --dependency servlet-api

@sghill Do you think servlet-api needs adding here

@sghill
Copy link

sghill commented Feb 16, 2025

Yes, agree with adding it to testCompileOnly

@basil
Copy link
Member

basil commented Feb 16, 2025

I think the issue is likely the inclusion of an old test harness that bundles Jetty 10 and EE 8. For 2.479.1 LTS and Java 17 the latest test harness should be used, which bundles Jetty 12 and EE 9.

rahulsom pushed a commit to rahulsom/gradle-jpi-plugin that referenced this pull request Feb 16, 2025
@rahulsom rahulsom deleted the support-jee9 branch February 16, 2025 02:37
rahulsom pushed a commit to rahulsom/gradle-jpi-plugin that referenced this pull request Feb 16, 2025
rahulsom pushed a commit to rahulsom/gradle-jpi-plugin that referenced this pull request Feb 16, 2025
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.

3 participants