-
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
Maven plugin incompatible with 3.3.9 #391
Comments
Some preliminary research led me to jeremylong/DependencyCheck#1054. The only thing that seems suspect from the stack trace is maybe the SLF4j support? The comparison between versions is pretty light, not a ton of things that could have caused the regression. |
Also worth noting that I updated to Maven 3.6 and it was no longer an issue. |
Sorry, I am afraid that was my mistake. When I did a research for #342, I focused on Gradle and saw that Maven also provides a SLF4J support for plugins. I assumed, but did not check, that like for Gradle, Maven uses SLF4J it since ages. Now I see that Maven actually introduced it with Maven 3.5.0 (released 2017-04-07). The previous Maven release version was 3.3.9 (released 2015-11-14) hadn't had it in. @phillipuniverse Can you live with the newer version of Maven? |
But only for maven versions older than 3.5.0, correct? I think that's okay. Especially if the first thing we log is something like
And in the meantime, our compat ranges are:
I think it's reasonable to just require 3.5.0: #259 But best of all would be to degrade to stdout logging, if that's not too difficult. |
Something puzzles me. The documentation states that we support Maven 3.1.0. But it seems that the testing is only using 3.5.2. Am I missing something? |
@lutovich might be able to correct me, but it might be as simple as |
I have to have another look at Maven. But I think we should start by correcting the Maven version in the tests and find a test case to reproduce the problem. |
Livable, but not great because it was a surprise (which I'm sure is something we all agree on). We had some other developers using the older version of Maven. IIRC, Maven 3.3 was the last LTS (somewhat assuming from the bolded versions at https://maven.apache.org/docs/history.html), it would probably be better to have compatibility with at least that. Unfortunate that true SLF4j support wasn't added until 3.5. |
I am affraid my previous comments contain a mistake: I was not able to reproduce the problem using Maven 3.1.0 and Maven 3.6.0 with Spotless Eclipse-JDT (similar to the configuration provided by @phillipuniverse above) nor with Spotless Eclipse-WTP (which uses SLF4 logger). It seems that the problem can occur due to dependency mediation in combination with other plugins. @phillipuniverse Could you provide a list of all plugins and versions you used, or a stripped down version of your POM, to help me reproducing the issue and see whether #397 solves it? |
Bump @phillipuniverse:
|
Sorry for the late reply here, this fell off my radar. Well now I don't know what to think. I switched back over to Maven 3.3.9, ran a |
Ok wow so this one was a doozy. Did more due diligence and it turns out this is uniquely because of the presence of the Dockerfile Maven plugin. I added a reproduction case with instructions at https://github.com/phillipuniverse/spotless-bug-example. |
@phillipuniverse Thanks for providing the example. Right at the moment I have no time for a further investigation. But I your example should give me sufficient input whether we should improve our Maven dependencies. |
As I see it, the problem was never SLF4J / spotless-eclipse-base related.
Debugging the Maven process showed that actually the Aether version 1.1.0 (API + Impl) was used. Maven 3.1.0 requires 0.9.0.M2.
The involved versions look like failed dependency mediation. So latest-greatest of Aether is used. But of course Maven class loader would prevent such a thing, and only Spotless seems to be affected. I think the problem is here:
We take an own version of the Maven Boot classloader on board. This does not feel right. First tests excluding the dependency from I think the usage of the own boot class loader classes causes some hick-ups with the dependency separation for each plugin. That`s why the problem always occurred somewhere else, depending on the plugins used and the order their dependencies have been analyzed. |
Exclusion of The problem is not deterministic. But it has been found with the latest version, that it only occurred with the Original problem with Maven 3.3.9 was not reproducible with reasonable effort. |
Summary of problem
Using the Spotless plugin in a Maven project and applying with Maven 3.3.9 throws an exception when I
mvn spotless:check
.It looks like this is only in 1.21.1, this was fine in 1.20.0.
gradlew spotless[Apply/Check] --stacktrace
https://gist.github.com/phillipuniverse/db14a796ffb4e8392da89c790537fd02
The text was updated successfully, but these errors were encountered: