-
-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
Steps to reproduce
- create a new Maven repository with only sources in
src/test/..
- there should be no java classes in
src/main/
- there should be no java classes in
- create a file that violates any Spotbugs rule in
src/test/
- add the Spotbugs Maven plugin to the pom.xml file
- set also the plugin's setting
includeTests
totrue
(includeTests)
- set also the plugin's setting
- execute Spotbugs by calling
mvn package
andmvn spotbugs:check
Observed behavior
No violation detected -> Build green
[INFO] --- spotbugs-maven-plugin:4.7.1.0:spotbugs (spotbugs) @ one-performance-tests ---
[INFO] Fork Value is true
[INFO] Done SpotBugs Analysis....
Expected behavior
Violation is printed and build fails.
Notes
- the when using the option
xmlOutput=true
the XML file is correctly written and contains violations - in the class
BaseViolationCheckMojo
(L490) only executes the violation verification if there are class files in the projects output directory (usuallytarget/classes
), which is empty for projects only having test sources - when we add a class like
src/main/Test.java
to our project, Spotbugs prints the violations and fails the build
Metadata
Metadata
Assignees
Labels
No labels