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 maven.compiler.testRelease in terms of maven.compiler.release #850

Merged
merged 1 commit into from Nov 2, 2023

Conversation

basil
Copy link
Member

@basil basil commented Nov 1, 2023

While writing jenkinsci/jep#400 (comment) I realized that there was no good reason not to define maven.compiler.testRelease in terms of maven.compiler.release. When defined in this way, a consumer that wants to use two different values can still do so, but a consumer that simply wants to change bytecode generation from Java 11 bytecode to e.g. Java 17 bytecode now only has to change one property instead of two, which is a net benefit. As of this PR, there is just one occurrence of "11" in the POM, which is the maven.compiler.release property, and this now becomes the only knob that needs to be tuned to decide on which bytecode should be generated.

Testing done

In text-finder-plugin I applied

diff --git a/pom.xml b/pom.xml
index 51a56f5..17b6a0d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.jenkins-ci.plugins</groupId>
     <artifactId>plugin</artifactId>
-    <version>4.75</version>
+    <version>4.76-SNAPSHOT</version>
     <relativePath />
   </parent>
 
@@ -48,6 +48,7 @@
     <jenkins.version>2.387.3</jenkins.version>
     <gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
     <spotless.check.skip>false</spotless.check.skip>
+    <maven.compiler.release>17</maven.compiler.release>
   </properties>
 
   <dependencyManagement>

and verified that I could open the project in an IDE, write code with Java 17 language features in a test, and run the test successfully both in the IDE and on the command-line.

@basil basil merged commit af8d8c4 into jenkinsci:master Nov 2, 2023
2 checks passed
@basil basil deleted the one-property-knob branch November 2, 2023 09:05
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.

None yet

2 participants