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 verifyphase.

issue submitted html report generation.

results can seen run mvn findbugs:gui


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -