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

Build fails due to the incompatibility of the class path for Guava while using Docker and Spotbug together #256

Open
pouryas7 opened this issue Aug 26, 2019 · 1 comment

Comments

@pouryas7
Copy link

I added docker plugin to my project (I've already have Spotbugs plugin). After that the build fails with the following error:

* What went wrong:
Execution failed for task ':spotbugsMain'.
> Failed to run Gradle SpotBugs Worker
   > Could not create an instance of type com.github.spotbugs.internal.spotbugs.SpotBugsExecutor.
      > com.google.common.collect.ImmutableList.builderWithExpectedSize(I)Lcom/google/common/collect/ImmutableList$Builder;

This issue is as same as this one:
spotbugs/spotbugs-gradle-plugin#120

Here, it is suggested that I should add Guava dependency to my project. I did that. I still face the same issue after.

plugins {
    ...
    id "com.palantir.docker" version "0.22.1"
    id "com.github.spotbugs" version "2.0.0"
    ...
}

repositories {
    mavenCentral()
}


dependencies {
...
   compile 'com.google.guava:guava:28.0-jre'
....
}

Any idea?

@pouryas7 pouryas7 changed the title Could not create an instance of type com.github.spotbugs.internal.spotbugs.SpotBugsExecutor Build fails due to the incompatibility of the class path for Guava while using Docker and Spotbug together Aug 26, 2019
@mum-viadee
Copy link

mum-viadee commented Sep 21, 2019

I just had the same problem. You must add guava as dependency in the buildscript to force the version for the plugins.

Just add
buildscript { dependencies { classpath 'com.google.guava:guava:23.1-jre' } }
in front of the plugin block.

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