sonar-findbugs icon indicating copy to clipboard operation
sonar-findbugs copied to clipboard

Got a ClassNotFoundException when running scanner with the latest version of sonar-findbugs

Open Lifedom opened this issue 1 year ago • 1 comments

Issue Description

This happend when I update this plugin to the newest version, but this not happend in old version. Also, it goes well without it.

Task :app:sonar WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.2.1) was tested up to compileSdk = 32

This warning can be suppressed by adding android.suppressUnsupportedCompileSdk=34 to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to use a newer Android Gradle Plugin that has been tested with compileSdk = 34

Task :app:sonar FAILED Kotlin build report is written to /var/lib/jenkins/workspace/xxx/build/reports/kotlin-build/xxx-build-2024-10-11-11-27-52.txt

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:sonar'.

Error creating bean with name 'ClassRealm{findbugs}-org.sonar.plugins.findbugs.FindbugsConfiguration': Resolution of declared constructors on bean Class [org.sonar.plugins.findbugs.FindbugsConfiguration] from ClassLoader [ClassRealm{findbugs}] failed; nested exception is java.lang.NoClassDefFoundError: org/sonar/plugins/java/api/JavaResourceLocator

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

Environment

Component Version
SonarQube 10.7
Sonar-FindBugs 4.2.10
Maven 3.9.2
Gradle 7.2.1
Java 17

Code (If needed)

Lifedom avatar Oct 11 '24 05:10 Lifedom

Hello, this looks like the same issue as #1014 Can you try setting the sonar.plugins.downloadOnlyRequired property to true?

gtoison avatar Oct 11 '24 07:10 gtoison

I'm closing this as a duplicate of #1014 and this should be fixed in the latest version released last week

gtoison avatar Nov 04 '24 07:11 gtoison