How to use a JUnit xml file in the folder surefire-reports, so that bugs are reported with sonarqube

java

(Markus Benkert) #1

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Version 7.6 (build 21501), maven dependency org.sonarsource.scanner.maven version 3.6.0.1398 und org.sonarsource.sonarqube version 7.6

  • what are you trying to achieve
    I’m trying to achieve, that a generated Junit XML Report is shown with the possibilities of sonarqube. B

  • what have you tried so far to achieve this

  1. General settings to Java and changed the Junit Report Paths => no effect, I see only “This project is empty.” What possible mistakes are here possible? path with / or with backslashes?

  2. I changed the maven settings.xml and add the following property tags:
    sonar.host.url
    sonar.projectKey
    sonar.sources
    sonar.tests
    sonar.junit.reportPath (several variations tested with no success: absolute path / relative path with backslash, with normal / )

this runs fine, but no report is shown after console: mvn sonar:sonar

always “This project is empty.” What possible mistakes are here possible?

Have something to be updated or another button pressed in sonarqube? I don’t know. Thank you for any help.


(Markus Benkert) #2

The problem has vanished. it was my mistake. The project is empty, because no code should be analysed and only the results of Junit test should be integrated, which can be found with its results in Tab coverage. That’s it.