Open rherrick opened 2 years ago
You could try using
spotbugsSlf4j group: 'org.slf4j', name: 'slf4j-api', version: '1.8.0-beta4'
spotbugsSlf4j group: 'org.slf4j', name: 'slf4j-simple', version: '1.8.0-beta4'
as mentioned here
In my case the SLF4J version was changed because of Spring Boot. You can use ./gradlew project:dependencies --configuration spotbugsSl4fj to see the details. If the versions for the API and for the implementation differ (one is 2.x the other is 1.x), you might have the same problem. For me it helped to add the slf4j-simple dependency to the spotbugs task (with a version as determined by the rest of my setup, in this case Spring Boot): https://github.com/C-Otto/BitBook/commit/9c9a353b732153596d7b016ce8e71e76be91f008
This is the same issue as #133 and #136.
During execution of the spotbugsMain and spotbugsTest tasks, warnings appear from slf4j. I've attached spotbugs-gradle-issue-demo.zip with a sample project, but to demonstrate it locally, I've also provided a patch and script to generate a sample project independently. This requires Java 11 and the [Spring Boot CLI|https://docs.spring.io/spring-boot/docs/current/reference/html/cli.html] (alternatively you could generate the initial project on [Spring Initializr|https://start.spring.io]).
Here's the output from the build:
The cause is pretty apparent:
I'm running on OS X 11.6.2 with Zulu Java 11.0.13, but replicated the issue on Ubuntu 20.04 with Zulu Java 11.0.14 as well. The script I ran contains:
Please let me know if I can provide any other info on this issue.