搜索Gradle插件

使用插件DSL

plugins {
  id("com.github.spotbugs-base") version "6.0.20"
}

使用旧版插件应用

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org.cn/m2/")
    }
  }
  dependencies {
    classpath("com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.20")
  }
}

apply(plugin = "com.github.spotbugs-base")

使用插件DSL

plugins {
  id "com.github.spotbugs-base" version "6.0.20"
}

使用旧版插件应用

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org.cn/m2/"
    }
  }
  dependencies {
    classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.20"
  }
}

apply plugin: "com.github.spotbugs-base"

了解如何将插件应用于子项目