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

Define Enforcer Java version in terms of maven.compiler.release #331

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

basil
Copy link
Member

@basil basil commented Nov 2, 2022

Alternative to #297. This matches the Maven Javadoc plugin, which uses the values of the maven.compiler.source and maven.compiler.release properties if defined. This alternative eliminates my two main objections to #297:

  • It only works for Java 9+, thus eliminating the negative incentive to stay on Java 8
  • It does not define a new API for consumers, thus not implicitly committing us to supporting arbitrary future Java versions via this mechanism. Rather this PR just makes it less likely that people who are using the existing Maven API will have trouble with Enforcer.

I tested this by compiling Jenkins core with -Dmaven.compiler.release=19 and -Dmaven.compiler.testRelease=19 and (after dealing with unrelated bugs) ensured that Java 19 bytecode got generated.

Closes #297.

@jglick
Copy link
Member

jglick commented Nov 2, 2022

It only works for Java 9+, thus eliminating the negative incentive to stay on Java 8

So who does this change help exactly? No one should be building anything in @jenkinsci currently with Java levels other than 8 or 11. Maybe I am missing something.

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Allows the Platform SIG and others to experiment with Java 19 and beyond.

@jglick
Copy link
Member

jglick commented Nov 2, 2022

As in creating draft PRs which require Java 19?

@basil
Copy link
Member Author

basil commented Nov 2, 2022

Yeah, I just did a local build with Java 19 bytecode with this PR to proactively identify areas that need work, such as jenkinsci/bridge-method-injector#29.

@basil basil merged commit 67764db into jenkinsci:master Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants