-
Notifications
You must be signed in to change notification settings - Fork 101
Change Maven property java.version to 11 #82
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
Change Maven property java.version to 11 #82
Conversation
@tkvangorder opened a PR as suggested! :) |
src/test/kotlin/org/openrewrite/java/migrate/SpringBootJavaVersion11Test.kt
Outdated
Show resolved
Hide resolved
type: specs.openrewrite.org/v1beta/recipe | ||
name: org.openrewrite.java.migrate.JavaVersion11 | ||
displayName: Change Maven property java.version to 11 | ||
description: Change the Maven compiler source and target versions to 11, via Spring Boot property java.version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was doubting to fully remove any mention of Spring here, as I'm not sure if the property is used as a convention in any other framework. So without the mention of Spring, we would also have to remove the maven compile source & target reference, as there's not guarantee it does anything at all if Spring is not present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way, welcome to change this as you see fit; I'll be asleep for the next few hours :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Yeah, you are right, I guess this property is more a "spring" thing.
I think it might be safer to add all three property changes (and only make the change if the property already exists)
java.version
maven.compiler.source
maven.compiler.target
That will take care of the three most common use cases.
Then beyond this, Once we have added plugin/pluginManagement to the semantic model for maven, this can be converted to an imperative recipe, so we can make decisions like "if the property is not defined, add it to the top-level pom"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a change to now also change the values of the maven compiler properties if present.
I'd be inclined to rename the recipe, displayName & description to reflect that we are changing the maven compiler source & target version, rather than any Spring/Java specific property. That's essentially what we aim to do here, with the Spring specifics just being an implementation detail for some projects.
Welcome to weigh in or make any changes to wrap this up. :)
Yep, I would just change the description to remove mention of "spring" and we are good to go. Thanks for your work on this. |
Ok all done; sadly just too late for the patch release, but still good to see this make it in. Would drop another manual step from my blogpost. :) |
Good news, since I am the one doing the point release....I will just release this project again. |
Partial fix for #66