Use SpotBugs plugin with multi-project Gradle builds

Based on Sharing build logic between subprojects Sample:

buildSrc/build.gradle

repositories {
    gradlePluginPortal() // so that external plugins can be resolved in dependencies section
}

dependencies {
    implementation 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.14'
}

buildSrc/src/main/groovy/myproject.java-common-conventions.gradle

plugins {
    id 'com.github.spotbugs'
}