It’s easy to add the findbugs plugin to maven so that it will run if I do
mvn site
However, I would like it to run whenever I do
mvn install
just like unit tests. That is, I don’t want the install to succeed if findbugs finds any bugs. Is there are way for me to do this?
About the findbugs:check goal, the documentation writes:
So this is precisely the goal you’re looking for. You now just have to bind the check goal to the
installverify phase (the verify phase occurs just before install and is actually made to run any checks to verify the package is valid and meets quality criteria so I think it’s a better choice):Of course, adapt the configuration to suit your needs.