【问题标题】:Maven FindBugs pluginMaven FindBugs 插件
【发布时间】:2010-10-04 23:58:05
【问题描述】:

你有用法: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>

但是一次:

mvn site

我明白了:

[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)

你知道为什么吗?我该怎么办?

【问题讨论】:

    标签: java maven-2 maven-plugin findbugs


    【解决方案1】:

    查看存储库,您的版本应该是 1.2,而不是 1.2.1

    另外,你的配置有误,你需要选择一些选项。所以它应该是这样的:

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

    【讨论】:

      【解决方案2】:

      试试看:

      <version>1.2</version>
      

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

      好像他们犯了一个简单的复制/粘贴错误。

      【讨论】:

        【解决方案3】:

        报告将位于目标/站点中。在浏览器中查看文件 index.html,而不是查找项目报告,然后查找错误报告。

        【讨论】:

          【解决方案4】:

          作为父项目结构的一部分,将 site.xml 放入 parent-project/src/site:

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

          “使用 Maven 更好地构建”(一本免费的在线书籍)中的示例 site.xml 应该可以帮助您入门。

          一旦 site.xml 创建,从父项目目录执行mvn site。它将获取您的报告设置,包括萤火虫报告。网站建成后,每个子项目都会有目录 /target/site,其中包含 index.html 和项目报告的链接。项目报告应包含萤火虫报告。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2012-08-08
            • 1970-01-01
            • 1970-01-01
            • 2015-11-11
            • 1970-01-01
            相关资源
            最近更新 更多