Maven execute a goal on build fail / FindBugs -
i have integrated findbugs plugin fail build in case of bugs.
using brilliant answer configured findbugs generate html reports (xml version barely readable).
problem have failonerror
property set true
, means build fail in case of bug.
..... <configuration> ..... <failonerror>true</failonerror> </configuration>
and no html report generated.
i read maven build lifecycle , there no such thing "execute on fail" (like finally
block in java). so, there possible workarounds? , shouldn't out-of box maven feature?
special @spacetrucker workaround suggestion. here configuration ended with:
<plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>findbugs-maven-plugin</artifactid> <version>3.0.4</version> <configuration> <effort>max</effort> <threshold>low</threshold> <findbugsxmloutputdirectory>${project.build.directory}/findbugs</findbugsxmloutputdirectory> </configuration> <executions> <execution> <id>nofailonerror</id> <phase>verify</phase> <goals> <goal>check</goal> </goals> <configuration> <failonerror>false</failonerror> </configuration> </execution> <execution> <id>failonerror</id> <phase>install</phase> <goals> <goal>check</goal> </goals> <configuration> <failonerror>true</failonerror> </configuration> </execution> </executions> </plugin>
the solution use different configurations in verify
, install
phases. note, according that answer transformation (to html) executed in verify
phase.
issue submitted html report generation.
results can seen run mvn findbugs:gui
Comments
Post a Comment