2011-01-10 4 views
9

Est-ce que quelqu'un a réussi à faire fonctionner les findbugs 2.3.1, 2.3.2-SNAPSHOT ou 2.4-SNAPSHOT avec un projet Maven 3.x?Findbugs et Maven 3.x

Je finis toujours avec:

[ERREUR] Échec de l'exécution but org.codehaus.mojo: findbugs-maven-plugin: 2.4-SNAPSHOT: findbugs (default-cli) sur culier du projet -db: Une erreur s'est produite dans la génération de rapport FindBugs Report . Impossible de trouver constructeur correspondant pour: org.codehaus.mojo.findbugs.FindbugsReportGenerator (org.codehaus.doxia.module.xhtml.XhtmlSink, java.util.PropertyResourceBundle, java.io.File, org.apache. maven.doxia.tools.DefaultSiteTool)

J'ai essayé toutes les dernières versions possibles. Peu importe si j'utilise findbugs: fingbugs ou seulement l'objectif du site. Il est précisé avec

<plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>findbugs-maven-plugin</artifactId> 
     <version>${findbugs.version}</version> 
     <configuration> 
     <threshold>High</threshold> 
     <effort>Default</effort> 
     </configuration> 
    </plugin> 
+0

Exécuté avec l'option -X, il n'y a pas grand chose à dire, il ne dit pas de constructeur correspondant. –

+0

Il est dit que vous devriez utiliser 2.3.2-SNAPSHOT avec maven 3 http://jira.codehaus.org/browse/MFINDBUGS-126 –

Répondre

11

Le 2011/03/20, Findbugs 2.3.2 a été publié, avec le support Maven 3.

Announcement

Release Notes

Cela signifie que vous devriez être en mesure d'utiliser la dernière version non-instantané du plug-in (version 2.3.2 ou ultérieure) avec Maven 3.

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>findbugs-maven-plugin</artifactId> 
    <version>2.3.2</version> 
</plugin> 
1

Comme je l'ai dit dans le commentaire, vous devez utiliser la version findbugs 2.3.2-SNAPSHOT avec Maven 3. J'ai commencé un projet en utilisant maven-quickstart-archetype et exécuté mvn findbugs:findbugs et les rapports sont générés avec succès sans aucun problème.

[INFO] ****** FindBugsMojo execute ******* 
[INFO] Inside canGenerateReport..... false 
[INFO] Inside canGenerateReport..... skip false, classFilesDirectory.exists() true 
[INFO] canGenerate is true 
[INFO] ****** FindBugsMojo executeReport ******* 
[INFO] Temp File is /home/umut/noinstall/dummy/target/findbugsTemp.xml 
[INFO] Fork Value is true 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2:56.550s 
[INFO] Finished at: Mon Jan 10 11:05:13 PST 2011 
[INFO] Final Memory: 9M/55M 
[INFO] ------------------------------------------------------------------------ 

Ce qui suit est le 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/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.dummy</groupId> 
    <artifactId>dummy</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>jar</packaging> 

    <name>dummy</name> 
    <url>http://maven.apache.org</url> 

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

    <pluginRepositories> 
     <pluginRepository> 
      <id>codehaus.snapshots</id> 
      <url>http://snapshots.repository.codehaus.org</url> 
     </pluginRepository> 
    </pluginRepositories> 

    <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>3.8.1</version> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 
    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>findbugs-maven-plugin</artifactId> 
       <version>2.3.2-SNAPSHOT</version> 
       <configuration> 
        <threshold>High</threshold> 
        <effort>Default</effort> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
</project> 

BTW vous avez raison, il ne fonctionne pas avec 2.3.1 mais je ne pas essayer 2.4-SNAPSHOT.

1

Juste une petite note pour quelqu'un avec le même problème: Mon expérience est que cela fonctionne avec 2.3.2-SNAPSHOT mais pas avec 2.4-SNAPSHOT. (2.4-SNAPSHOT provoque la même erreur.)