-
Notifications
You must be signed in to change notification settings - Fork 460
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
Assure Maven 3.1.0 compatibility and fix dependencies #397
Conversation
Since a full year has elapsed, I'm guessing this will end up not getting merged. Happy to reopen or discuss further if you'd like to revisit. |
The core problems addressed by this PR remains:
|
I don't know anything about maven. If you'd like to merge this PR @fvgh feel free, but probably best to first request a review from lutovich in case they've got any opinions. |
@lutovich I am afraid I am not a Maven expert myself. I started this PR, since the initial #391 description suggested some spotless-eclipse-base problems with SLF4J and the underlying Maven. But this was not the case. The problem I see with the Plexus Classworld should not only affect Maven 3.1.0, but also higher version. Can you have a look? It is not urgent, since the issue is anyhow open since many month. |
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.
@fvgh thank you for investigating this problem! It does look very complex. I added one comment on this PR.
plugin-maven/build.gradle
Outdated
@@ -69,7 +69,9 @@ dependencies { | |||
implementation "com.diffplug.spotless:spotless-lib-extra:${libVersion}" | |||
} | |||
|
|||
implementation "org.codehaus.plexus:plexus-resources:${VER_PLEXUS_RESOURCES}" | |||
implementation("org.codehaus.plexus:plexus-resources:${VER_PLEXUS_RESOURCES}") { | |||
exclude group: 'classworld', module: 'classworld' |
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.
Is it "classworld" or "classworlds"?
I think the chain of transitive dependencies goes like this:
org.codehaus.plexus:plexus-resources:jar:1.0.1:compile
+- org.codehaus.plexus:plexus-utils:jar:3.0.8:compile
\- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
\- classworlds:classworlds:jar:1.1-alpha-2:compile
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.
Thanks for the heads-up. I need another look...
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.
I am afraid the problem I have found during investigation of #391 is sporadic, hence I assumed that my findings fixed the problem. So to conclude:
- Problem described in Maven plugin incompatible with 3.3.9 #391 cannot be reproduced.
- Problem found in during investigation of Maven plugin incompatible with 3.3.9 #391 is sporadic.
- I have no time to investigate any further. Will reword this PR and make it an enhancement.
Would it be okay to bump |
This was also an idea. But I found the reasoning behind the change in plexus-resources #2 unrelated to the issue I found. So I just want to avoid regression for now. Anyhow, I have to have another look about the reproducibility of the error and the assumed solution. |
5b83ed7
to
b2b956b
Compare
@lutovich Please have a final look. All the changes are just enhancements, but not bug fixes. |
#391 reported an incompatibility of the spotless-maven-plugin with Maven 3.3.9.
The Spotless Maven ReadMe claims that the spotless-maven-plugin is compatible with Maven 3.1.0.
Research suggested that the problem is related to version conflicts regarding provided dependencies with other plugins. A similar issue occurred in the Spotbugs Maven plugin.
Due to Maven dependency mediation, it seems incorrect to use newer dependencies than required and provided by Maven 3.1.0.
The original problem reported in #391 could not be reproduced.
But problems with Maven 3.1.0 showed that the Maven System class loader is a transitive dependency of the Spotless plugin, which should not be the case. Further investigation showed that this was most likely not caused by spotless.
Current PR just improves Maven plugin test and dependencies.