Maven FindBugs 插件
您有用法: 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)
Do你知道为什么? 我应该怎么办?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
查看存储库,您的版本应该是1.2,而不是1.2.1
另外,您的配置是错误的,您需要选择一些选项。 所以它应该看起来像:
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:
尝试一下:
http://repo2.maven.org/ maven2/org/codehaus/mojo/findbugs-maven-plugin/
看起来他们做了一个简单的复制/粘贴错误。
try that:
http://repo2.maven.org/maven2/org/codehaus/mojo/findbugs-maven-plugin/
Seems like they did a simple copy/paste error.
报告将位于目标/站点。 在浏览器中查看文件index.html,然后查找项目报告,然后查找bugs报告。
The report will be in target/site. Look at the file index.html in a browser, than look for project reports, then findbugs report.
作为父项目结构的一部分,将 site.xml 放入parent-project/src/site:
“Better Builds with Maven”(在线免费书籍)中的 site.xml 示例应该可以帮助您入门。
创建 site.xml 后,从父项目目录执行
mvn site
。 它将获取您的报告设置,包括萤火虫报告。 站点构建完成后,每个子项目都会有目录 /target/site,其中包含带有项目报告链接的 index.html。 项目报告应包含萤火虫报告。As part of your parent project structure place site.xml into parent-project/src/site:
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.