-
Notifications
You must be signed in to change notification settings - Fork 136
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
NoClassDefFoundError after Sonar update from 10.4 to 10.5 #1014
Comments
Thanks for reporting the issue, and I think you've figured out the root of the problem, as well as a workaround. I've asked the SonarQube team if there's a way to declare a dependency on the built-in sonar-java plugin. #1015 reproduces the problem |
For anyone else affected by the issue, it seems that the |
For our Maven-based build, setting this option as an analyzer configuration via Maven was sufficient, and the server setting can remain enabled. |
Just to be 100% @gtoison . The solution right now is to set |
Since SonarQube 10.5 the analyzer only downloads the plugins relevant to the languages detected in your project, unless is It is a workaround, but last time I have checked Sonarsource said that they do not intend to provide plugins with a way to express dependencies on another plugin. |
so the correct fix requires the sonar-java plugin to add the kt file suffix? |
I doubt Sonarsource would change that in their built-in plugin: it is for java, not Kotlin. We happen to be using it here because it locates the compiled .class files. One way would be for Sonarsource to let plugin express a plugin dependency: the Findbugs plugin could then say that it always needs the sonar-java plugin. They have considered it but most probably won't do it. Another way would be for the Findbugs plugin to no longer depend on the sonar-java plugin. That would entail rewriting some of the code from sonar-java, and maintaining it. Finding the time to do that is a bit challenging for me right now but contributions are much welcome! |
We are seeing this problem in Java projects, which are using Kotlin for the gradle file. |
Hum, Sonarqube should activate the sonar-java plugin if it sees .java sources (unless they are filtered out?) |
I tried this with a Java project with Kotlin gradle file:
Replacing the kotlin gradle file with a groovy gradle file yields a similar result:
|
The pure java write the following in the debug log:
|
There is a multi-module project built and analyzed as part of the integration tests in this project, it seems to work OK with Gradle so I'm not sure what might be different for you @Munken |
@gtoison running
on the multi module project yields the same error. My point is that this plugin seems to break even on pure java projects. |
I've made a Pull Request with changes to hopefully solve this problem: in #1033 the plugin does not rely on the built-in sonar-java. So it should work even if Sonarqube decides that the project does not need to download sonar-java. If anyone affected here could test this with a real-world project that would be much appreciated. Check out the https://github.com/gtoison/sonar-findbugs/tree/bunde-sonar-java branch and run |
Hi @gtoison I tested with
So the changes in #1033 work on our system. Please release ASAP 👍 However, in #1033
|
Nevermind, that last paragraph.
|
@gtoison what is blocking this? Something you need help with? |
Sorry, it's mostly the lack of free time on my end. |
This issue should be fixed in version 4.3.0 released yesterday |
Issue Description
Since we updated our Sonar to 10.5 our call to
./gradlew sonar
fails.We can solve the problem by using
-Dsonar.plugins.downloadOnlyRequired=false
.Its a Kotlin only project and maybe the detection of the required plugins is broken.
Environment
Log
The text was updated successfully, but these errors were encountered: