Etam
Etam

Reputation: 4673

Maven FindBugs plugin

You have usage: findbugs-maven-plugin

<project>
  [...]
  <reporting>
    [...]
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>findbugs-maven-plugin</artifactId>
      <version>1.2.1</version>
      <configuration>
        <xmlOutput>true|false</xmlOutput>
        <xmlOutputDirectory>directory location of findbugs xdoc xml report</xmlOutputDirectory>
        <threshold>High|Normal|Low|Exp|Ignore</threshold>
        <effort>Min|Default|Max</effort>
        <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
        <includeFilterFile>findbugs-include.xml</includeFilterFile>
        <visitors>FindDeadLocalStores,UnreadFields</visitors>
        <omitVisitors>FindDeadLocalStores,UnreadFields</omitVisitors>
        <onlyAnalyze>org.codehaus.mojo.findbugs.*</onlyAnalyze>
        <pluginList>/libs/fb-contrib/fb-contrib-2.8.0.jar</pluginList>
        <debug>true|false</debug>
        <relaxed>true|false</relaxed>
        <findbugsXmlOutput>true|false</findbugsXmlOutput>
        <findbugsXmlOutputDirectory>directory location of findbugs legact xml format report</findbugsXmlOutputDirectory>
      </configuration>
    </plugin>
    [...]
  </reporting>
  [...]
</project>

But once:

mvn site

I get:

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.codehaus.mojo
ArtifactId: findbugs-maven-plugin
Version: 1.2.1

Reason: Unable to download the artifact from any repository

  org.codehaus.mojo:findbugs-maven-plugin:pom:1.2.1

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

Do you know why? What should I do?

Upvotes: 2

Views: 14037

Answers (4)

01es
01es

Reputation: 5410

As part of your parent project structure place site.xml into parent-project/src/site:

 |--- src 
      |---site
            |---site.xml 

An example site.xml from "Better Builds with Maven" (a free book available online) should get you started.

Once site.xml is created, execute mvn site from the parent project directory. It will pick up your reporting settings including the firebug report. Once the site is built, each child project will have directory /target/site, which contains index.html with a link to project reports. The project reports should contain firebug reports.

Upvotes: 0

Rob Di Marco
Rob Di Marco

Reputation: 45002

The report will be in target/site. Look at the file index.html in a browser, than look for project reports, then findbugs report.

Upvotes: 0

Rob Di Marco
Rob Di Marco

Reputation: 45002

Looking at the repository, your version should be 1.2, not 1.2.1

Also, your configuration is wrong, you need to choose some of the options. So it should look like:

    <plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>findbugs-maven-plugin</artifactId>
  <version>1.2</version>
  <configuration>
    <threshold>High</threshold>
    <effort>Default</effort>
  </configuration>
</plugin>

Upvotes: 6

Loki
Loki

Reputation: 30970

try that:

<version>1.2</version>

http://repo2.maven.org/maven2/org/codehaus/mojo/findbugs-maven-plugin/

Seems like they did a simple copy/paste error.

Upvotes: 2

Related Questions