name.remal.spotbugs-settings

Plugin class: name.remal.gradle_plugins.plugins.code_quality.spotbugs.SpotBugsSettingsPlugin

plugins {
    id 'name.remal.spotbugs-settings' version '1.0.203'
}
plugins {
    id("name.remal.spotbugs-settings") version "1.0.203"
}

 

This plugin works only if java and com.github.spotbugs plugins are applied.

 

This plugin helps to configure SpotBugs.

  • It updates SpotBugs version to the latest one.
  • It forces SpotBugs dependencies to have the same version as SpotBugs itself.
  • It creates a draft of SpotBugs exclusions file in $rootDir/gradle/spotbugs/exclude.xml. This file will will be used as default value of spotbugs.excludeFilter.
  • It excludes all relocated classes from the analysis.
  • It enables XML report, customize HTML report and print all violations to console.

Also the plugin creates spotbugs.excludes extension of type ExcludesExtension to setup default exclusions. The same extension is created for every SpotBugs task to extend exclusions.

 

name.remal.gradle_plugins.plugins.code_quality.ExcludesExtension

Property Type Description
classNames MutableSet<String> ANT like exclude patterns of class names.
sources MutableSet<String> ANT like exclude patterns of source files.
messages MutableSet<String> Violation messages to exclude.
Method Description
void className(String value) Add ANT like exclude pattern of class names.
void classNames(String... values) Add ANT like exclude patterns of class names.
void classNames(Iterable<String> values) Add ANT like exclude patterns of class names.
void source(String value) Add ANT like exclude pattern of source files.
void sources(String... values) Add ANT like exclude patterns of source files.
void sources(Iterable<String> values) Add ANT like exclude patterns of source files.
void message(String value) Add violation message to exclude.
void messages(String... values) Add violation messages to exclude.
void messages(Iterable<String> values) Add violation messages to exclude.
void kotlin() Exclude Kotlin sources.
void groovy() Exclude Groovy sources.