How to generate html report for issues reported using sonarqube-5.4 and maven?

15,745

Solution 1

As documented the Issues Report Plugin is not compatible with versions 5.1 and greater. SonarLint for Command-Line should be used to get the same feature. It is simple to enable with Maven:

mvn sonar:sonar -Dsonar.analysis.mode=preview -Dsonar.issuesReport.html.enable=true

Paths to the generated HTML reports are displayed in logs:

[INFO] HTML Issues Report generated: /xxx/target/sonar/issues-report/issues-report.html
[INFO] Light HTML Issues Report generated: /xxx/target/sonar/issues-report/issues-report-light.html
[INFO] ANALYSIS SUCCESSFUL

Solution 2

Cycle of steps.

mvn clean install
mvn sonar:sonar -Dsonar.issuesreport.html.enable=true

As per the source, build should happen before the analysis. sonar:sonar triggers maven surefire plugin to execute.

Share:
15,745
S.B
Author by

S.B

Updated on June 17, 2022

Comments

  • S.B
    S.B almost 2 years

    I have checked the link:sonarqube issues report,but not clear on how to achive it during maven build.

  • Martin J.H.
    Martin J.H. about 4 years
    SonarLint for command line has been deprecated and is not longer available.