java - How to generate HTML report with Maven FindBugs? -
i know similar question has been asked here, setup within pom.xml bit different , answer isn't working case.
i have findbugs set when run [mvn compile findbugs:findbugs], default findbugsxml.xml generated. html file generated it's more readable. below i've added pom.xml in order findbugs set up. i'm not sure why html file isn't being generated given i've included specification when making pom.xml edits. below added plugins section of build in pom.xml.
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <artifactid>findbugs-cookbook</artifactid> <packaging>jar</packaging> <version>3.0.1</version> <name>findbugs maven plugin cookbook</name> <description>findbugs maven plugin cookbook</description> <licenses> <license> <name>apache license 2.0</name> <url>http://www.apache.org/licenses/license-2.0</url> </license> </licenses> <properties> <jdk.version>1.7</jdk.version> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <build> <finalname>findbugs</finalname> <resources> <resource> <filtering>true</filtering> <directory>src/main/resources</directory> </resource> </resources> <plugins> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>findbugs-maven-plugin</artifactid> <version>3.0.1</version> </plugin> <!--</plugins> <plugins> --> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <source>${jdk.version}</source> <target>${jdk.version}</target> <encoding>${project.build.sourceencoding}</encoding> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-resources-plugin</artifactid> <version>3.0.1</version> <configuration> <encoding>${project.build.sourceencoding}</encoding> </configuration> </plugin> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>findbugs-maven-plugin</artifactid> <version>3.0.1</version> <configuration> <effort>max</effort> <failonerror>false</failonerror> <findbugsxmloutputdirectory>${project.build.directory}/findbugs</findbugsxmloutputdirectory> <threshold>low</threshold> <xmloutput>true</xmloutput> </configuration> <executions> <execution> <id>analyze-compile</id> <phase>compile</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>xml-maven-plugin</artifactid> <version>1.0</version> <configuration> <transformationsets> <transformationset> <dir>${project.build.directory}/findbugs</dir> <outputdir>${project.build.directory}/findbugs</outputdir> <!--<stylesheet>fancy-hist.xsl</stylesheet> --> <!--<stylesheet>default.xsl</stylesheet> --> <!--<stylesheet>plain.xsl</stylesheet>--> <!--<stylesheet>fancy.xsl</stylesheet>--> <!--<stylesheet>summary.xsl</stylesheet>--> <filemappers> <filemapper implementation="org.codehaus.plexus.components.io.filemappers.fileextensionmapper"> <targetextension>.html</targetextension> </filemapper> </filemappers> </transformationset> </transformationsets> </configuration> <executions> <execution> <phase>compile</phase> <goals> <goal>transform</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupid>com.google.code.findbugs</groupid> <artifactid>findbugs</artifactid> <version>3.0.1</version> </dependency> </dependencies> </plugin> </plugins> </build>
i'm using apache maven 3.2.3 , java version: 1.8.0_20. i've included findbugs-3.0.1.jar , findbugs-maven-plugin-3.0.1.jar in apache-maven-3.2.3 directory.
there 4 variables:
- java/jdk version
- maven version
- findbugs plugin version
- findbugs version
with java-1.7, works on windows system specified versions of maven, findbugs, findbugs-maven-plugin. older versions of findbugs not work java 8.
with java-1.8, works if use version 3.0.1 of findbugs , findbugs-maven-plugin.
since have bound
findbugs
goals compile
task, need run mvn clean compile
.
Comments
Post a Comment