Skip to content

Require Java 21 in plugin pom#1286

Merged
NotMyFault merged 2 commits intojenkinsci:masterfrom
NotMyFault:jdk21
Jan 2, 2026
Merged

Require Java 21 in plugin pom#1286
NotMyFault merged 2 commits intojenkinsci:masterfrom
NotMyFault:jdk21

Conversation

@NotMyFault
Copy link
Member

@NotMyFault NotMyFault commented Jan 2, 2026

Signed-off-by: Alexander Brandes <mc.cache@web.de>
@NotMyFault NotMyFault changed the title Require Java 21 Require Java 21 in plugin pom Jan 2, 2026
@NotMyFault NotMyFault marked this pull request as ready for review January 2, 2026 18:58
@NotMyFault NotMyFault requested a review from timja January 2, 2026 18:58
Signed-off-by: Alexander Brandes <mc.cache@web.de>
@NotMyFault NotMyFault enabled auto-merge (squash) January 2, 2026 22:51
@NotMyFault NotMyFault merged commit 7d6ddb2 into jenkinsci:master Jan 2, 2026
14 checks passed
@jglick
Copy link
Member

jglick commented Jan 5, 2026

I am trying to refresh my memory of how we handled Java bumps in the past, but I think this should be reverted (other than the 6 major version—too late!) and deferred. jenkinsci/jenkins#26018 has not even been released in a weekly yet, so where did the 2.516 dep come from? And the whole point of jenkinsci/maven-hpi-plugin#323 + #523 was that we would not need to make these incompatible changes to the plugin POM merely in order to support plugins which wish to depend on recent jenkins.versions that require a newer Java. Instead, that would be automatic, and then as a matter of cleanup we would bump the minimum core (to the first weekly using that Java version) and the fallback default Java version in the plugin POM some months after the new requirement appears in an LTS release, at which point by the guidelines most plugins would be able to pick up the bump anyway. Compare the merge timing of #478 to the announcements and changelog.

@NotMyFault NotMyFault deleted the jdk21 branch January 5, 2026 15:37
@NotMyFault
Copy link
Member Author

I wasn't aware of jenkinsci/maven-hpi-plugin#323, we can surely roll this release back, no?

@jglick
Copy link
Member

jglick commented Jan 5, 2026

we can surely roll this release back, no?

Well, it would be a 6.x version, if anyone cares.

Ping @timja / @MarkEWaite / @jtnord in case anyone else has more context on this.

@jtnord
Copy link
Member

jtnord commented Jan 5, 2026

I wasn't aware of jenkinsci/maven-hpi-plugin#323, we can surely roll this release back, no?

yes, the properties should get overridden when the hpi-plugin runs to set the compiler release etc based on the version of Jenkins in use.

@NotMyFault NotMyFault self-assigned this Jan 5, 2026
@NotMyFault
Copy link
Member Author

Will revert this evening and locations I've bumped it.

@jglick
Copy link
Member

jglick commented Jan 5, 2026

and locations I've bumped it

No need I think. AFAICT there is not much harm in the current release; it just cannot be used in plugins using somewhat older jenkins.versions. So it should suffice to push out a new release reverting this PR (minus the major version) and let people update to that normally. Later in 2026, when the LTS requiring 21+ is widely adopted, it should be OK to restore it.

NotMyFault added a commit to NotMyFault/plugin-pom that referenced this pull request Jan 5, 2026
NotMyFault added a commit to NotMyFault/plugin-pom that referenced this pull request Jan 5, 2026
jglick added a commit that referenced this pull request Jan 5, 2026
…c5a73a734ae4f3e6114

Revert "Require Java 21 in plugin pom (#1286)"
@uhafner
Copy link
Member

uhafner commented Jan 11, 2026

I wasn't aware of jenkinsci/maven-hpi-plugin#323, we can surely roll this release back, no?

yes, the properties should get overridden when the hpi-plugin runs to set the compiler release etc based on the version of Jenkins in use.

But that does not work with the enforcer properties, or am I doing something wrong? When I set a dependency to Jenkins 2.545 then I get:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.6.2:enforce (display-info) on project analysis-pom: 
[ERROR] Rule 5: org.codehaus.mojo.extraenforcer.dependencies.EnforceBytecodeVersion failed with message:
[ERROR] Found Banned Dependency: org.jenkins-ci:task-reactor:jar:1.10
[ERROR] Found Banned Dependency: org.jenkins-ci:symbol-annotation:jar:1.26
[ERROR] Found Banned Dependency: org.jenkins-ci.main:jenkins-core:jar:2.545
[ERROR] Found Banned Dependency: org.jenkins-ci.main:websocket-spi:jar:2.545
[ERROR] Found Banned Dependency: org.kohsuke.stapler:stapler:jar:2065.v7db_c1fcf0a_d0
[ERROR] Found Banned Dependency: org.kohsuke.stapler:stapler-groovy:jar:2065.v7db_c1fcf0a_d0
[ERROR] Found Banned Dependency: org.kohsuke.stapler:stapler-jelly:jar:2065.v7db_c1fcf0a_d0
[ERROR] Found Banned Dependency: org.jenkins-ci.main:cli:jar:2.545
[ERROR] Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[ERROR] -> [Help 1]

@timja
Copy link
Member

timja commented Jan 12, 2026

But that does not work with the enforcer properties, or am I doing something wrong? When I set a dependency to Jenkins 2.545 then I get:

Is that with:
#1337

I tried on credentials plugin after updating the parent pom to latest and it worked fine.

@uhafner
Copy link
Member

uhafner commented Jan 12, 2026

No, without. When I remove the enforcer properties in jenkinsci/analysis-pom-plugin#1461, then my build fails with the message from above.

But maybe this is a problem in my parent pom, I haven't tried without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants