Plugin with id 'com.github.spotbugs' not found
Asked Answered
H

0

7

I'm configuring SpotBugs plugin for a Gradle project for the first time.

buildscript {
  repositories {
    maven {
      url 'https://plugins.gradle.org/m2/'
    }
  }
  dependencies {
    classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.6'
  }
}

apply plugin: 'com.github.spotbugs'

When running gradle check I'm getting error Plugin with id 'com.github.spotbugs' not found. What am I doing wrong?

Gradle version 5.0.

Hapten answered 15/12, 2018 at 4:28 Comment(5)
Have you also had a look at this? spotbugs.readthedocs.io/en/latest/gradle.htmlGrubman
Your build script works for me with an otherwise empty Gradle 5.0 project (using a Gradle wrapper). The only change I’ve made to your build script is to add apply plugin: 'java' at the end to actually get the check task to test with. Do you have caches/modules-2/files-2.1/gradle.plugin.com.github.spotbugs/spotbugs-gradle-plugin/1.6.6/ in you Gradle user home (typically ~/.gradle/)? Otherwise there might have been an issue with your network connection to the Gradle plugins repository.Torsion
Why not use plugins { id "com.github.spotbugs" version "1.6.6" } DSL?Drumbeat
I'm having almost the same problem: The configuration you're using works for me - but I get the same error (Plugin with id 'com.github.spotbugs' not found) if I move it from build.gradle to another file (spotbugs.gradle) an apply in build.gradle with apply from: 'spotbugs.gradle'Pugh
I had the same problem, have a look at my solution github.com/spotbugs/spotbugs/issues/1027#issuecomment-548588144Rainout

© 2022 - 2024 — McMap. All rights reserved.