2011-08-20 65 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。

相關問題