英文:
maven spotbugs doesn't generate report
问题
我根据其网站上的文档配置了Maven SpotBugs插件,但它没有生成报告。
运行时我看到了这行内容:
mvn site -X
> [INFO] 15 reports detected for
> maven-project-info-reports-plugin:3.1.0: ci-management, dependencies,
> dependency-info, dependency-management, distribution-management,
> index, issue-management, licenses, mailing-lists, modules,
> plugin-management, plugins, scm, summary, team [DEBUG] ******
> SpotBugsMojo canGenerateReport
> ******* [DEBUG] canGenerate is false
请注意最后一行!
英文:
I configured maven spotbugs plugin based on docs on its website, but it doesn't generate report.
This was a line I saw when running
mvn site -X
> [INFO] 15 reports detected for
> maven-project-info-reports-plugin:3.1.0: ci-management, dependencies,
> dependency-info, dependency-management, distribution-management,
> index, issue-management, licenses, mailing-lists, modules,
> plugin-management, plugins, scm, summary, team [DEBUG] ******
> SpotBugsMojo canGenerateReport
> ******* [DEBUG] canGenerate is false
Please watch the last line!
答案1
得分: 1
通过检查源代码,我发现在能够运行任何检查之前,需要在目标(target)文件夹中生成一个"classes"文件夹。
因此,正确的运行方式是:
mvn compile site
这会在目标(target)文件夹中生成"classes",并在控制台上输出以下日志:
> [INFO] 检测到 15 个报告用于 maven-project-info-reports-plugin:3.1.0: ci-management、dependencies、dependency-info、dependency-management、distribution-management、index、issue-management、licenses、mailing-lists、modules、plugin-management、plugins、scm、summary、team [DEBUG] ******
> SpotBugsMojo 可以生成报告 ******* [DEBUG] 可以生成的源代码为真
> [DEBUG] ****** SpotBugsMojo 执行 Spotbugs ******* [DEBUG] ******
> 正在执行 SpotBugsMojo
英文:
I found out through checking source code that it needs to have classes folder generated in target before being able to run any check.
So right way to run it is
mvn compile site
Which generates classes in target folder and writes this log to console:
> [INFO] 15 reports detected for
> maven-project-info-reports-plugin:3.1.0: ci-management, dependencies,
> dependency-info, dependency-management, distribution-management,
> index, issue-management, licenses, mailing-lists, modules,
> plugin-management, plugins, scm, summary, team [DEBUG] ******
> SpotBugsMojo canGenerateReport ******* [DEBUG] canGenerate Src is true
> [DEBUG] ****** SpotBugsMojo executeSpotbugs ******* [DEBUG] ******
> Executing SpotBugsMojo *******
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论