Skip to content

Maven plugin reporting issue if "adjustPriority" is not set #3774

@iloveeclipse

Description

@iloveeclipse

Would I expect to have a number of new bugs added that were not there before? Both choose visitors and omit visitors tests in the maven plugin integration suite are now failing. Normally all the integration tests just run so I'm thinking this one noting possible behaviour difference could be what did it. However, I get the same difference with single module run.

Here is test before (note this is without images)
choose-visitors-4.9.6.html

Here is the test after (note this is without images)
choose-visitors-4.9.7.html

This change seems most likely to be involved.

Integration test failures seen here

Originally posted by @hazendaz in #3753

Regression from #3753.

I couldn't find any BugReporter in maven plugin code, so I assume all output is generated somehow by FindBugs2 created via AntBuilder here:

https://github.com/spotbugs/spotbugs-maven-plugin/blob/8bedb8ee38971883cd4fcbd2801bc2a959907bc4/src/main/groovy/org/codehaus/mojo/spotbugs/SpotBugsMojo.groovy#L1157C50-L1158

This should call FindBugs2.main() and this should call TextUICommandLine and it should actually be configured here

for (TextUIBugReporter reporter : reporters) {
reporter.setPriorityAdjuster(priorityAdjuster);
}

I believe -adjustPriority is not (always) given by maven. That would result in not created PriorityAdjuster instance. As a workaround, one can try to use something like edu.umd.cs.findbugs.detect.CheckCalls=+0 value for -adjustPriority argument (shouldn't change anything except that PriorityAdjuster would be created).

I will try to provide a fix for TextUICommandLine now.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions