SonarQube integrating with jenkins and svn and maven facing issue with analysis

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

sonarqube 7.5
scanner sonar-scanner-4.0.0.1744-windows
maven 3.5
java 1.8

i am trying to analyze the svn data through sonarqube facing below issue. only showing xml data not showing java related report

Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.1.1688:sonar (default-cli) on project 5536 ‘other’ has different root -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

Hi,

Welcome to the community!

Have you tried this?:

Also, it would probably help to describe your procedure.

 
Ann

Thank you Ann for your reply i have changed sonar installation path and tried to deploy now i am getting build success but sonar report it is showing only xml data not showing source code could you please help me on this

FYI,

[WARNING] File ‘D:\SONAR_POC\JenkinsHome\workspace\5536_Jenkins_AutomationTest\src\main\java\ext\com\iic\wc\util\ImagePageUtils.java’ is ignored. It is not located in module basedir ‘D:\BuildRepository\CustomFiles\5536_Jenkins_AutomationTest’.
[INFO] 1 file indexed
[INFO] 0 files ignored because of inclusion/exclusion patterns
[INFO] Quality profile for xml: Sonar way
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=395ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1/1 source files have been analyzed
[WARNING] Metric ‘comment_lines_data’ is deprecated. Provided value is ignored.
[INFO] Sensor XML Sensor [xml] (done) | time=127ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=7ms
[INFO] No SCM system was detected. You can use the ‘sonar.scm.provider’ property to explicitly specify it.
[INFO] Calculating CPD for 0 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 87ms, dir size=79 KB
[INFO] Analysis reports compressed in 16ms, zip size=12 KB
[INFO] Analysis report uploaded in 41ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=com%3A5536_Jenkins_AutomationTest
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at http://localhost:9000/api/ce/task?id=AW1OWi9cLF3RfA9dn3WP
[INFO] Task total time: 5.046 s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.738 s
[INFO] Finished at: 2019-09-20T16:36:36+05:30

Build status success but java code not analyzed can anyone help me on this below is the log.
please let me know any details required.

image

Started by user Jenkins_Admin Running as SYSTEM Building in workspace E:\sw\JenkinsHome\workspace\MAVEN_JENKINS_POC Updating https://DESKTOP-8E3IKPC/svn/SONAR_MAVEN_POC/Build at revision ‘2019-09-22T10:34:45.259 +0530’ --quiet Using sole credentials test/****** in realm ‘<https://desktop-8e3ikpc:443> VisualSVN Server’ At revision 5 No changes for https://desktop-8e3ikpc/svn/SONAR_MAVEN_POC/Build since the previous build Parsing POMs Established TCP socket on 55061 [SONAR_POC] $ “C:\Program Files\Java\jdk1.8.0_161/bin/java” -cp E:\sw\JenkinsHome\plugins\maven-plugin\WEB-INF\lib\maven35-agent-1.13.jar;E:\sw\apache-maven-3.6.1\boot\plexus-classworlds-2.6.0.jar;E:\sw\apache-maven-3.6.1/conf/logging jenkins.maven3.agent.Maven35Main E:\sw\apache-maven-3.6.1 E:\sw\JenkinsHome\war\WEB-INF\lib\remoting-3.33.jar E:\sw\JenkinsHome\plugins\maven-plugin\WEB-INF\lib\maven35-interceptor-1.13.jar E:\sw\JenkinsHome\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.13.jar 55061 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -B -f E:\SONAR_POC\pom.xml clean install sonar:sonar [INFO] Scanning for projects… [INFO] [INFO] ------------------< com.maven.poc:MAVEN_JENKINS_POC >------------------- [INFO] Building MAVEN_JENKINS_POC Maven Webapp 0.0.1-SNAPSHOT [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] — maven-clean-plugin:2.5:clean (default-clean) @ MAVEN_JENKINS_POC — [INFO] Deleting E:\SONAR_POC\target [INFO] [INFO] — maven-resources-plugin:2.6:resources (default-resources) @ MAVEN_JENKINS_POC — [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory E:\SONAR_POC\src\main\resources [INFO] [INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ MAVEN_JENKINS_POC — [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! [INFO] Compiling 1 source file to E:\SONAR_POC\target\classes [INFO] [INFO] — maven-resources-plugin:2.6:testResources (default-testResources) @ MAVEN_JENKINS_POC — [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory E:\SONAR_POC\src\test\resources [INFO] [INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ MAVEN_JENKINS_POC — [INFO] No sources to compile

[INFO] [INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ MAVEN_JENKINS_POC — [INFO] No tests to run. [JENKINS] Recording test results [INFO] [INFO] — maven-war-plugin:2.6:war (default-war) @ MAVEN_JENKINS_POC — [INFO] Packaging webapp [INFO] Assembling webapp [MAVEN_JENKINS_POC] in [E:\SONAR_POC\target\MAVEN_JENKINS_POC] [INFO] Processing war project [INFO] Webapp assembled in [103 msecs] [INFO] Building war: E:\SONAR_POC\target\MAVEN_JENKINS_POC.war [INFO] [INFO] — maven-install-plugin:2.4:install (default-install) @ MAVEN_JENKINS_POC — [INFO] Installing E:\SONAR_POC\target\MAVEN_JENKINS_POC.war to C:\Users\SREENU.m2\repository\com\maven\poc\MAVEN_JENKINS_POC\0.0.1-SNAPSHOT\MAVEN_JENKINS_POC-0.0.1-SNAPSHOT.war [INFO] Installing E:\SONAR_POC\pom.xml to C:\Users\SREENU.m2\repository\com\maven\poc\MAVEN_JENKINS_POC\0.0.1-SNAPSHOT\MAVEN_JENKINS_POC-0.0.1-SNAPSHOT.pom

[INFO] [INFO] ------------------< com.maven.poc:MAVEN_JENKINS_POC >------------------- [INFO] Building MAVEN_JENKINS_POC Maven Webapp 0.0.1-SNAPSHOT [INFO] --------------------------------[ war ]--------------------------------- [INFO] [INFO] — sonar-maven-plugin:3.6.1.1688:sonar (default-cli) @ MAVEN_JENKINS_POC — [INFO] User cache: C:\Users\SREENU.sonar\cache [INFO] SonarQube version: 7.5.0 [INFO] Default locale: “en_IN”, source code encoding: “windows-1252” (analysis is platform dependent)

[INFO] Publish mode [INFO] Load global settings [INFO] Load global settings (done) | time=84ms [INFO] Server id: BF41A1F2-AW0_hy-3skqzJQsZeTak [INFO] User cache: C:\Users\SREENU.sonar\cache [INFO] Load/download plugins [INFO] Load plugins index

[INFO] Load plugins index (done) | time=110ms [INFO] Load/download plugins (done) | time=136ms [INFO] Loaded core extensions: [INFO] Process project properties [INFO] Execute project builders [INFO] Execute project builders (done) | time=3ms [INFO] Load project repositories [INFO] Load project repositories (done) | time=69ms [INFO] Load quality profiles [INFO] Load quality profiles (done) | time=35ms [INFO] Load active rules

[INFO] Load active rules (done) | time=2443ms [INFO] Load metrics repository [INFO] Load metrics repository (done) | time=22ms [WARNING] SCM provider autodetection failed. Please use “sonar.scm.provider” to define SCM of your project, or disable the SCM Sensor in the project settings. [INFO] Project key: com.maven.poc:MAVEN_JENKINS_POC [INFO] Project base dir: E:\SONAR_POC [INFO] ------------- Scan MAVEN_JENKINS_POC Maven Webapp [INFO] Base dir: E:\SONAR_POC [INFO] Working dir: E:\SONAR_POC\target\sonar [INFO] Source paths: pom.xml, E:\sw\JenkinsHome\workspace\MAVEN_JENKINS_POC\src\main\java [INFO] Source encoding: windows-1252, default locale: en_IN [INFO] Index files [WARNING] File ‘E:\sw\JenkinsHome\workspace\MAVEN_JENKINS_POC\src\main\java\SampleTest.java’ is ignored. It is not located in module basedir ‘E:\SONAR_POC’. [INFO] 1 file indexed [INFO] Quality profile for xml: Sonar way

[INFO] Sensor JaCoCo XML Report Importer [jacoco] [INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms [INFO] Sensor SonarJavaXmlFileSensor [java] [INFO] 1 source files to be analyzed [INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=385ms [INFO] 1/1 source files have been analyzed [INFO] Sensor XML Sensor [xml]

[WARNING] Metric ‘comment_lines_data’ is deprecated. Provided value is ignored. [INFO] Sensor XML Sensor [xml] (done) | time=170ms [INFO] Sensor Zero Coverage Sensor [INFO] Sensor Zero Coverage Sensor (done) | time=7ms [INFO] No SCM system was detected. You can use the ‘sonar.scm.provider’ property to explicitly specify it. [INFO] Calculating CPD for 0 files [INFO] CPD calculation finished [INFO] Analysis report generated in 81ms, dir size=71 KB [INFO] Analysis reports compressed in 13ms, zip size=11 KB [INFO] Analysis report uploaded in 39ms [INFO] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=com.maven.poc%3AMAVEN_JENKINS_POC [INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report [INFO] More about the report processing at http://localhost:9000/api/ce/task?id=AW1XW9kcc6oJ_LN036B6 [INFO] Task total time: 5.223 s [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.732 s [INFO] Finished at: 2019-09-22T10:35:00+05:30 [INFO] ------------------------------------------------------------------------ Waiting for Jenkins to finish collecting data

[JENKINS] Archiving E:\SONAR_POC\pom.xml to com.maven.poc/MAVEN_JENKINS_POC/0.0.1-SNAPSHOT/MAVEN_JENKINS_POC-0.0.1-SNAPSHOT.pom [JENKINS] Archiving E:\SONAR_POC\target\MAVEN_JENKINS_POC.war to com.maven.poc/MAVEN_JENKINS_POC/0.0.1-SNAPSHOT/MAVEN_JENKINS_POC-0.0.1-SNAPSHOT.war channel stopped

Finished: SUCCESS

Hi,

What is your build/analysis procedure? I.e. what commands do you use? Also, have you specified any exclusions? Have you provided a sonar.properties file, and if so, what are its contents?

 
Ann