sbt-findbugs
sbt-findbugs copied to clipboard
Add pluginList support for FindSecurityBugs
In order to add the FindSecurityBugs plugin to our build, we needed to have access to FindBugs's plugin mechanism. This pull requests gives this access. Here's a usage example:
findbugsSettings
findbugsReportPath := Some(crossTarget.value / "findbugs" / "report.html")
findbugsReportType := Some(ReportType.PlainHtml)
findbugsPluginList += s"${Path.userHome.absolutePath}/.ivy2/cache/com.h3xstream.findsecbugs/findsecbugs-plugin/jars/findsecbugs-plugin-1.4.5.jar"
findbugsIncludeFilters := Some(<FindBugsFilter>
<Match>
<Bug category="SECURITY"/>
</Match>
</FindBugsFilter>)
compile <<= (compile in Compile).dependsOn(FindBugs.findbugs)
I have a recommendation: In CommandLine, add a check that the file exists, e.g.:
for(path <-findbugsPluginList) { if(!java.nio.file.Files.exists(java.nio.file.Paths.get(path))) { streams.log.error("Error: Could not find plugin" + path); } }
Does anyone know the status here? I would be really cool to have a way to configure findbugs plugins!