https://github.com/daggerok/spotbugs-gradle-plugin-multi-project-example
SpotBugs Gradle plugin with HTML report in multi-project build
https://github.com/daggerok/spotbugs-gradle-plugin-multi-project-example
multi-project multi-project-build multiproject multiprojects spotbugs spotbugs-gradle-plugin spotbugs-plugin
Last synced: 9 months ago
JSON representation
SpotBugs Gradle plugin with HTML report in multi-project build
- Host: GitHub
- URL: https://github.com/daggerok/spotbugs-gradle-plugin-multi-project-example
- Owner: daggerok
- Created: 2019-01-06T01:56:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-18T22:09:28.000Z (about 7 years ago)
- Last Synced: 2025-01-10T00:42:24.554Z (over 1 year ago)
- Topics: multi-project, multi-project-build, multiproject, multiprojects, spotbugs, spotbugs-gradle-plugin, spotbugs-plugin
- Language: Java
- Homepage: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/32
- Size: 57.6 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spotbugs gradle multi-project build [](https://travis-ci.org/daggerok/spotbugs-gradle-plugin-multi-project-example)
Example of usage `spotbugs-gradle-plugin` (findbugs replacement) with HTML reports enabled in multi module Gradle project
config:
`build.gradle` file:
```gradle
buildscript {
ext {
spotbugsVersion = '1.6.8'
toolVersion = '3.1.10'
}
}
plugins {
id 'com.github.spotbugs' version '1.6.8' apply false
}
apply from: "$rootProject.projectDir/gradle/spotbugs.gradle"
defaultTasks 'clean', 'check'
```
`gradle/spotbugs.gradle` file:
```gradle
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:$spotbugsVersion"
}
}
subprojects {
apply plugin: "com.github.spotbugs"
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
spotbugs {
toolVersion = project.toolVersion
effort = "max"
ignoreFailures = project.findProperty('ignoreBugs') != null
}
tasks.withType(com.github.spotbugs.SpotBugsTask) {
reports {
html {
enabled = true
}
xml {
enabled = false
}
}
}
}
```
versions:
- gradle: 5.1
- spotbugs-gradle-plugin: 1.6.8
- tool: 3.1.10
usage:
```bash
./gradlew # to be failed
./gradlew -PignoreBugs # do not failed on found bugs
```
links:
- [spotbugs gradle plugin html report in multi-project issue](https://github.com/spotbugs/spotbugs-gradle-plugin/issues/32)
- [not generates HTML report when lombok gradle plugin enabled issue](https://github.com/spotbugs/spotbugs-gradle-plugin/issues/94)