-
Notifications
You must be signed in to change notification settings - Fork 874
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
Implement maven pom javac release option hint (JEP 247). #4802
Conversation
oops. forgot the license headers. Let me fix this :) |
38ab661
to
e59154d
Compare
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/UseReleaseOptionHint.java
Outdated
Show resolved
Hide resolved
if maven-compiler-plugin version is <3.6 it would not be able to use the release parameter. |
e59154d
to
2680d68
Compare
@ebarboni good to know! How do I compare versions? Is there a utility for this? there would be this: edit: added a little utility method which checks compatibility |
648b2e4
to
b479f7b
Compare
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/UseReleaseOptionHint.java
Show resolved
Hide resolved
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/UseReleaseOptionHint.java
Show resolved
Hide resolved
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/UseReleaseOptionHint.java
Show resolved
Hide resolved
@matthiasblaesing do you have any remaining concerns integrating this in the current form or should we move it to NB17? |
b479f7b
to
dfe3c5a
Compare
fixed potential NPE when artifactID is null |
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/UseReleaseOptionHint.java
Show resolved
Hide resolved
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/UseReleaseOptionHint.java
Show resolved
Hide resolved
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/UseReleaseOptionHint.java
Show resolved
Hide resolved
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/UseReleaseOptionHint.java
Show resolved
Hide resolved
java/maven.hints/src/org/netbeans/modules/maven/hints/pom/UseReleaseOptionHint.java
Show resolved
Hide resolved
No problem - with the reasoning that 8 is dead and thus release will always be there, we are only missing a corner-case. The approach for the properties seems reasonable. |
dfe3c5a
to
9e3ca57
Compare
- converts matching source/target options to the release option - supports properties and the standard maven-compiler-plugin - offers only hints when source/release is set to at least 9+
9e3ca57
to
21510a8
Compare
@neilcsmith-net is master already branched? Or can I still merge? |
@mbien you have about 10 minutes! 😄 |
awesome merged. Usually I would wait for approval but I think I addressed all review comments and implemented everything. If there is an issue left, it probably not going to be a big one and I can fix it during RC. |
It is fairly basic and has a small cosmetic issue. I don't know how to replace elements in-place, so it simply adds the release element to the end of the list if the hint is applied, no matter where source/target was.
I also don't know how to apply hints in the junit tests. When I tried to do that it complained that the model was read only (org.netbeans.modules.xml.xam.dom.ReadOnlyAccess). I suppose its a dummy model.
How to test:
create a new java project and it should already show the hint. It only looks for properties and the config of the standard javac plugin.