We are using Sonar to do Java static code check in our jenkins. As you know, there are two ways to implement it, one is using SonarScanner with configuration file sonar-project.properties, the other is way is using Maven(need to do some configuration with pom.xml).
Now we would like to integrate pmd and checkstyle. When using the latter way (Maven), we can refer link [External Analyzer Reports] Report generation for Java / Maven. After running mvn command, file checkstyle-result.xml and pmd.xml can be found under target folder.
However, currently we would like to prefer the former way (with sonar-project.properties) because it will decouple from java project, below is the configuration for pmd and checkstyle.
But when running command sonar-scanner, there will be some errors, see below:
ERROR: Failed to import external issues report:C:\..\target\checkstyle-result.xml
java.io.FileNotFoundException: C:\..\target\checkstyle-result.xml (The system cannot find the path specified)
So I guess it can not run pmd and checkstyle by sonar-project.properties, is that right?
Below is the system environment.
SonarQube version 7.6
SonarScanner version 4.0
SonarQube, natively, cannot run PMD and Checkstyle, only consume the reports those tools generate. You’ll need to run those tools to generate the reports prior to your SonarQube analysis. Adding the analysis parameters won’t do that for you.
My project is generating pmd.xml file, but when I analyze the project in SonarQube… the violations are not shown anywhere?
where can i check the violations?