You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 7, 2019. It is now read-only.
FindBugs Maven Plugin behaves differently depending whether src/main/java is empty or not. If it doesn't exist (module is test-only and contains only src/test/java) build is not failing:
When there is some production code in module (src/main/java not empty) the build fails:
[INFO] --- findbugs-maven-plugin:3.0.3:findbugs (findbugs) @ findbugs-fail-build ---
[INFO] Fork Value is true
[java] Warnings generated: 1
[INFO] Done FindBugs Analysis....
[INFO]
[INFO] <<< findbugs-maven-plugin:3.0.3:check (findbugs) < :findbugs @ findbugs-fail-build <<<
[INFO]
[INFO] --- findbugs-maven-plugin:3.0.3:check (findbugs) @ findbugs-fail-build ---
[INFO] BugInstance size is 1
[INFO] Error size is 0
[INFO] Total bugs: 1
[INFO] Private method io.github.mkordas.ClassWithFindBugsViolationInTest.unusedPrivateMethod() is never called [io.github.mkordas.ClassWithFindBugsViolationInTest] At ClassWithFindBugsViolationInTest.java:[line 5] UPM_UNCALLED_PRIVATE_METHOD
[INFO]
To see bug detail using the Findbugs GUI, use the following command "mvn findbugs:gui"
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
I think it is bug in FindbugsViolationCheckMojo there's an if checking whether 'main' classes exist and if not, plugin assumes that there was nothing analyzed and code to fail the build is not invoked.
There are two workarounds:
add <classFilesDirectory>${project.build.testOutputDirectory}</classFilesDirectory>
to configuration
add any code to src/main/java
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
FindBugs Maven Plugin behaves differently depending whether
src/main/java
is empty or not. If it doesn't exist (module is test-only and contains onlysrc/test/java
) build is not failing:When there is some production code in module (
src/main/java
not empty) the build fails:I think it is bug in FindbugsViolationCheckMojo there's an if checking whether 'main' classes exist and if not, plugin assumes that there was nothing analyzed and code to fail the build is not invoked.
There are two workarounds:
<classFilesDirectory>${project.build.testOutputDirectory}</classFilesDirectory>
to configuration
src/main/java
The text was updated successfully, but these errors were encountered: