Skip to content
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

4.0.0: Failed to run Gradle SpotBugs Worker #20

Closed
mduft opened this issue Dec 10, 2019 · 2 comments
Closed

4.0.0: Failed to run Gradle SpotBugs Worker #20

mduft opened this issue Dec 10, 2019 · 2 comments

Comments

@mduft
Copy link

mduft commented Dec 10, 2019

When upgrading from 3.4.0 to 4.0.0 I keep getting this error message:

> Failed to run Gradle SpotBugs Worker
   > Process 'Gradle SpotBugs Worker 48' finished with non-zero exit value 1

I'm running gradle 5.6, but also upgrading to 6.0.1 does not help with this...

When running with --debug, I see this exception in the logs:

2019-12-10T16:26:16.417+0100 [DEBUG] [system.err] java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: org.slf4j.simple.SimpleServiceProvider not a subtype
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1236)
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1264)
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at org.slf4j.LoggerFactory.findServiceProviders(LoggerFactory.java:106)
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at org.slf4j.LoggerFactory.bind(LoggerFactory.java:149)
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:141)
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:413)
2019-12-10T16:26:16.417+0100 [DEBUG] [system.err]       at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:405)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:354)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:380)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.internal.concurrent.CompositeStoppable.<clinit>(CompositeStoppable.java:37)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.internal.service.DefaultServiceRegistry$OwnServices.<init>(DefaultServiceRegistry.java:371)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.internal.service.DefaultServiceRegistry.<init>(DefaultServiceRegistry.java:99)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.internal.service.DefaultServiceRegistry.<init>(DefaultServiceRegistry.java:86)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.internal.logging.services.LoggingServiceRegistry.<init>(LoggingServiceRegistry.java:50)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.internal.logging.services.LoggingServiceRegistry$CommandLineLogging.<init>(LoggingServiceRegistry.java:164)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.internal.logging.services.LoggingServiceRegistry$CommandLineLogging.<init>(LoggingServiceRegistry.java:164)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.internal.logging.services.LoggingServiceRegistry.newEmbeddableLogging(LoggingServiceRegistry.java:104)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:88)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:69)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:68)
2019-12-10T16:26:16.418+0100 [DEBUG] [system.err]       at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:73)

I did some googling but nothing helpful popped up. You can have a look at our build.gradle here: https://github.com/bdeployteam/bdeploy/blob/master/build.gradle

I am aware that this might not be an issue with the quality plugin itself, but since this is what I updated, I'm reporting here :)

@xvik
Copy link
Owner

xvik commented Dec 10, 2019

This looks like spotbugs/spotbugs-gradle-plugin#11

Spotbugs plugin slf4j-simple transitive dependency version must be different than slf4 gradle version (leading to java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: org.slf4j.simple.SimpleServiceProvider not a subtype)

The simplest workaround is to exclude this dependency:

configure(actualSubprojects) {
    apply plugin: 'java'
    ...

    afterEvaluate {
        configurations.spotbugs { exclude module: 'slf4j-simple' }
    }

afterEvaluate is required because spotbugs plugin activation is delayed

The downside is absence of spotbugs logs:

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.

Everything was working with quality plugin 3.4.0 because it was using spotbugs plugin 1.6.5 and 4.0.0 use 2.0.1.
slf4j-simple dependency was added in 1.6.10 and all spotbugs plugin versions after it also affected

Ideally, this must be investigated further to propose more correct slf4j version resolution instead of current, but I don't have much time now for it, so I propose (for now) to keep this issue opened for anyone else facing a similar problem.

@mduft
Copy link
Author

mduft commented Dec 11, 2019

This works, nice, thanks :) For me this is good enough for now...

@xvik xvik closed this as completed in 4ac1be8 Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants