From 64f949976477c72086b7d09a8cc4e5d4d1fe9334 Mon Sep 17 00:00:00 2001 From: gtoison Date: Fri, 15 Dec 2023 09:05:27 +0100 Subject: [PATCH] Added support for SpotBugs' noClassOk option --- .../org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy index b5039b83..92e87d9e 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy @@ -64,6 +64,14 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { @Parameter(defaultValue = "false", property = "spotbugs.xmlOutput", required = true) boolean xmlOutput + /** + * Output empty warning file if no classes are specified. + * + * @since 4.8.3.0 + */ + @Parameter(defaultValue = "false", property = "spotbugs.noClassOk", required = true) + boolean noClassOk + /** * Turn on and off HTML output of the Spotbugs report. * @@ -1026,6 +1034,10 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait { args << testClassFilesDirectory.absolutePath } + if (noClassOk) { + args << "-noClassOk" + } + return args }