Skip to content

Commit 1a6d381

Browse files
authored
Merge pull request #1030 from hazendaz/master
Move object closure to usage and add additional logging
2 parents 4e541ff + 0090e9f commit 1a6d381

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy

+22-5
Original file line numberDiff line numberDiff line change
@@ -756,68 +756,84 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
756756
private ArrayList<String> getSpotbugsArgs(File htmlTempFile, File xmlTempFile, File sarifTempFile) {
757757
ResourceHelper resourceHelper = new ResourceHelper(log, spotbugsXmlOutputDirectory, resourceManager)
758758
List<String> args = new ArrayList<>()
759-
File auxClasspathFile = createSpotbugsAuxClasspathFile()
760759

761760
if (userPrefs) {
762-
log.debug(" Adding User Preferences File -> ${userPrefs}")
761+
log.debug(" Adding User Preferences File -> ${userPrefs}")
763762

764763
args << '-userPrefs'
765764
args << resourceHelper.getResourceFile(userPrefs.trim())
766765
}
767766

768767
if (htmlOutput) {
768+
log.debug(" Adding 'htmlOutput'")
769769
args << '-html=' + htmlTempFile.getAbsolutePath()
770770
}
771771

772+
log.debug(" Adding 'xml:withMessages'")
772773
args << '-xml:withMessages=' + xmlTempFile.getAbsolutePath()
773774

774775
if (sarifOutput) {
776+
log.debug(" Adding 'sarifOutput'")
775777
args << '-sarif=' + sarifTempFile.getAbsolutePath()
776778
}
777779

780+
File auxClasspathFile = createSpotbugsAuxClasspathFile()
781+
778782
if (auxClasspathFile) {
783+
log.debug(" Adding 'auxclasspathFromFile'")
779784
args << '-auxclasspathFromFile'
780785
args << auxClasspathFile.getAbsolutePath()
781786
}
782787

788+
log.debug(" Adding 'projectName'")
783789
args << '-projectName'
784790
args << "${project.name}"
785791

792+
log.debug(" Adding 'effortParameter'")
786793
args << getEffortParameter()
794+
795+
log.debug(" Adding 'thresholdParameter'")
787796
args << getThresholdParameter()
788797

789798
if (debug) {
790-
log.debug('progress on')
799+
log.debug(" Adding 'progress'")
791800
args << '-progress'
792801
}
793802

794803
if (pluginList || plugins) {
804+
log.debug(" Adding 'pluginList'")
795805
args << '-pluginList'
796806
args << getSpotbugsPlugins()
797807
}
798808

799809

800810
if (visitors) {
811+
log.debug(" Adding 'visitors'")
801812
args << '-visitors'
802813
args << visitors
803814
}
804815

805816
if (omitVisitors) {
817+
log.debug(" Adding 'omitVisitors'")
806818
args << '-omitVisitors'
807819
args << omitVisitors
808820
}
809821

810822
if (relaxed) {
823+
log.debug(" Adding 'relaxed'")
811824
args << '-relaxed'
812825
}
813826

814827
if (nested) {
828+
log.debug(" Adding 'nested:true'")
815829
args << '-nested:true'
816830
} else {
831+
log.debug(" Adding 'nested:false'")
817832
args << '-nested:false'
818833
}
819834

820835
if (onlyAnalyze) {
836+
log.debug(" Adding 'onlyAnalyze'")
821837
args << '-onlyAnalyze'
822838
args << Arrays.stream(onlyAnalyze.split(SpotBugsInfo.COMMA)).map {
823839
it.startsWith("file:") ? Files.lines(resourceHelper.getResourceFile(it.substring(5)).toPath())
@@ -826,7 +842,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
826842
}
827843

828844
if (includeFilterFile) {
829-
log.debug(' Adding Include Filter File ')
845+
log.debug(' Adding Include Filter File')
830846

831847
String[] includefilters = includeFilterFile.split(SpotBugsInfo.COMMA)
832848

@@ -895,6 +911,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
895911
}
896912

897913
if (maxRank) {
914+
log.debug(" Adding 'maxRank'")
898915
args << '-maxRank'
899916
args << maxRank
900917
}
@@ -910,7 +927,7 @@ class SpotBugsMojo extends AbstractMavenReport implements SpotBugsPluginsTrait {
910927
}
911928

912929
if (noClassOk) {
913-
log.debug(' Adding no class ok')
930+
log.debug(" Adding 'noClassOk'")
914931
args << '-noClassOk'
915932
}
916933

0 commit comments

Comments
 (0)