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

SpotBugs support is broken in Gradle 6.4 #26

Closed
jjathman opened this issue May 6, 2020 · 4 comments
Closed

SpotBugs support is broken in Gradle 6.4 #26

jjathman opened this issue May 6, 2020 · 4 comments

Comments

@jjathman
Copy link

jjathman commented May 6, 2020

After upgrading to Gradle 6.4 we get this error:

Caused by: java.lang.NoSuchMethodError: org.gradle.process.internal.worker.WorkerProcessFactory.singleRequestWorker(Ljava/lang/Class;Ljava/lang/Class;)Lorg/gradle/process/internal/worker/SingleRequestWorkerProcessBuilder;
        at com.github.spotbugs.internal.spotbugs.SpotBugsWorkerManager.createWorkerProcess(SpotBugsWorkerManager.java:19)
        at com.github.spotbugs.internal.spotbugs.SpotBugsWorkerManager.runWorker(SpotBugsWorkerManager.java:14)
        at com.github.spotbugs.SpotBugsTask.run(SpotBugsTask.java:287)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:49)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:722)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:689)
...

From what I can tell this API is no longer used in recent versions of the SpotBugs Plugin. But the quality plugin pulls in an old version.

Reading the docs it looks as though I should be able to use a newer version of the plugin by setting

classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.0.8"

but that doesn't seem to work and I still see the error. I'm wondering if it's because the group changed for the plugin?

@xvik
Copy link
Owner

xvik commented May 6, 2020

Spotbugs plugin 4 was a rewrite and it works differently. I tried to update some time ago, but it wasn't simple so I postpone it.

Not only group changed between 2 and 4:

gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.0.8
com.github.spotbugs:spotbugs-gradle-plugin:2.0.1

but also package, so the current quality plugin is not compatible with the new spotbugs plugin.

I mention this problem in docs:
you can only disable automatic spotbugs support (quality.spotbugs = false) and apply new spotbugs plugin manually.

I will, of course, support the new spotbugs plugin but it may require some time.

@jjathman
Copy link
Author

jjathman commented May 6, 2020

Yep, disabling SpotBugs is what we've done for now. I'm just recommending our teams to not upgrade to Gradle 6.4 for now, I don't think there were any must-have features for us anyones. Thanks for taking a look at it!

@hafeez1988
Copy link

I'm facing the same issue. My jenkins build is getting the latest Gradle whenever it builds the project. Since Gradle 6.4 released recently my build is getting failed due SpotBugs issue in ru.vyarus.quality plugin. Appreciate if we could have a fix for this soon.

@xvik
Copy link
Owner

xvik commented May 13, 2020

4.3.0 released

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

3 participants