简体   繁体   中英

maven spotbugs doesn't generate report

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!

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 *******

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM