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

[maven hints] try to infer compiler plugin version from active maven version. #5693

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

mbien
Copy link
Member

@mbien mbien commented Mar 21, 2023

The plugin version query returns the version of the embedded maven distribution instead of the active distribution. This started causing issues the moment #5679 was implemented which upgrades embedded maven to a version which provides a JDK 9+ compatible plugins out of the box (which is a good thing).

We can workaround this problem by comparing maven versions, since we can infer the plugin version from it under certain conditions.

Fixes the release option and the module-info hint.

@mbien mbien added the Maven [ci] enable "build tools" tests label Mar 21, 2023
@matthiasblaesing
Copy link
Contributor

Nice idea. I think though, that I spotted a problem: Consider the situation where a new enough maven is present, but the compiler plugin is configured to an older version (for example because the project has $years of history). If I understand correctly, this might not be reported as an error.

@mbien
Copy link
Member Author

mbien commented Mar 22, 2023

If I understand correctly, this might not be reported as an error.

@matthiasblaesing agreed, we have to be especially careful with "false warnings".

Its just that while testing #5679 I noticed that some hints won't appear at all since the embedded version of NB would be very recent, other hints will try to add the compiler plugin despite it already being there with the required version.

Most of the maven editor support features only work properly right now if you leave the setting at "Bundled" and don't use a wrapper. This is a larger problem overall.

@mbien mbien force-pushed the fix-maven-compiler-plugin-checks branch from 24f1fad to b71f24a Compare March 30, 2023 01:19
@mbien mbien marked this pull request as ready for review March 30, 2023 01:23
@mbien mbien added this to the NB18 milestone Mar 30, 2023
Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

Looks sane to me.

The plugin version query returns the version of the embedded maven
distribution and not the verison of the active distribution.

This worked fine until maven updated the versions of their implicitly
provided lifecycle plugins (which is a good thing), then it broke.

We can workaround this problem by comparing maven versions, since
we can infer the plugin version from it under certain conditions.

Fixes the release option and the module-info hint.
@mbien mbien force-pushed the fix-maven-compiler-plugin-checks branch from b71f24a to 71172ed Compare March 31, 2023 00:41
@mbien
Copy link
Member Author

mbien commented Mar 31, 2023

i made small changes to the comments to make them less confusing. Planning to merge once green again, thanks for review.

@mbien mbien changed the title check maven version as workaround instead of embedded plugin version. [maven hints] try to infer compiler plugin version from active maven version. Mar 31, 2023
@mbien mbien added the hints label Mar 31, 2023
@mbien mbien merged commit 6c21c06 into apache:master Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hints Maven [ci] enable "build tools" tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants