2011-08-20 69 views
0

如何使用maven项目通过eclipse运行findbugs。我在maven中配置为:通过maven eclipse运行findbugs

<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/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.home.app</groupId> 
    <artifactId>home-app</artifactId> 
    <version>0.0.1</version> 
    <packaging>jar</packaging> 

    <name>home-app</name> 
    <url>http://maven.apache.org</url> 

    <properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <build> 
    <plugins>  
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>findbugs-maven-plugin</artifactId> 
     <version>2.3.2</version> 
     <configuration> 
      <effort>Max</effort> 
      <threshold>Low</threshold> 
      <xmlOutput>true</xmlOutput> 
     </configuration> 
     <executions> 
      <execution> 
      <phase>verify</phase> 
      <goals> 
       <goal>check</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin>   
    </plugins> 
    </build> 
    <dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
    </dependencies> 
</project> 

我想知道findbugs报告的错误/警告是什么。

回答

2

您可以在目标目录中创建的通常编译包阶段中找到该报告。如果您希望看到更具可读性的输出,则必须在报告块中使用findbugs目标,而不是构建块。

1

你也可以使用findbugs的eclipse插件,它会给你一个很好的eclipse窗口,它可以直接指向你所有的bug。