I'm having the following problem with a Maven project on our Jenkins server while running the Sonarqube maven plugin in a Jenkins pipeline.
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:54 min
[INFO] Finished at: 2017-11-14T11:42:51+00:00
[INFO] Final Memory: 74M/606M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project pandora-parent-pom: Malformed input or input contains unmappable characters: src/main/webapp/images/D??rogations.ep
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Malformed input or input contains unmappable characters: src/main/webapp/images/D??rogations.ep
at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:80)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:139)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: src/main/webapp/images/D??rogations.ep
at sun.nio.fs.UnixPath.encode(UnixPath.java:147)
at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
at sun.nio.fs.AbstractPath.resolve(AbstractPath.java:53)
at org.sonar.api.batch.fs.internal.DefaultInputFile.path(DefaultInputFile.java:83)
at org.sonar.api.batch.fs.internal.DefaultInputFile.file(DefaultInputFile.java:75)
at org.sonar.api.batch.fs.internal.PathPattern$RelativePathPattern.match(PathPattern.java:101)
at org.sonar.batch.scan.filesystem.LanguageDetection.isCandidateForLanguage(LanguageDetection.java:124)
at org.sonar.batch.scan.filesystem.LanguageDetection.language(LanguageDetection.java:97)
at org.sonar.batch.scan.filesystem.InputFileBuilder.completeAndComputeMetadata(InputFileBuilder.java:98)
at org.sonar.batch.scan.filesystem.FileIndexer$1.call(FileIndexer.java:164)
at org.sonar.batch.scan.filesystem.FileIndexer$1.call(FileIndexer.java:161)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[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]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The file itself is named Dérogations.ep .
The part of the Jenkinsfile which contains the Sonar execution
stage('Sonar') {
withSonarQubeEnv('SonarQube') {
updateGitlabCommitStatus(name: 'sonar', state: 'running')
configFileProvider([configFile(fileId: 'ec266a3e-2586-4b2c-b0bb-386603d5a4ef', variable: 'MAVEN_SETTINGS')]) {
sh "export"
sh "${mvnHome}/bin/mvn org.jacoco:jacoco-maven-plugin:prepare-agent install -s $MAVEN_SETTINGS -Pcoverage-per-test -Dmaven.test.failure.ignore"
sh "export"
sh "${mvnHome}/bin/mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -s $MAVEN_SETTINGS -Dsonar.branch=${env.BRANCH_NAME} -Dmaven.test.failure.ignore"
sh "export"
jacoco()
}
updateGitlabCommitStatus(name: 'sonar', state: 'success')
}
}
The export call returns (amongst others) these params, which I assigned to our build node.
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
export LC_COLLATE='en_US.UTF-8'
export LC_CTYPE='en_US.UTF-8'
The maven-compiler-plugin and maven-resources-plugin are also configured in UTF-8 and the Sonar logs also suggest that everything is nicely in UTF-8 (except for one file which is in ISO-8859)
[INFO] ------------- Scan MP services jenkins
[INFO] Base dir: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services
[INFO] Working dir: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/sonar
[INFO] Source paths: pom.xml, src/main/java
[INFO] Test paths: src/test/java
[INFO] Binary dirs: target/classes
[INFO] Source encoding: UTF-8, default locale: en_US
[INFO] Index files
[INFO] 299 files indexed
[INFO] Quality profile for java: MP
[INFO] Sensor Lines Sensor
[INFO] Sensor Lines Sensor (done) | time=14ms
[INFO] Sensor JavaSquidSensor
[INFO] Configured Java source version (sonar.java.source): 7
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=1ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=3ms
[INFO] Java Main Files AST scan
[INFO] 293 source files to be analyzed
[INFO] 196/293 files analyzed, current file: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/src/main/java/be/MP/xxx/MP/dao/impl/HistoriqueActionServiceImpl.java
[INFO] 283/293 files analyzed, current file: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/src/main/java/be/MP/xxx/MP/service/impl/SourceAuthentiqueServiceImpl.java
[INFO] 293/293 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.portlet.PortletRequest]
[INFO] Java Main Files AST scan (done) | time=21386ms
[INFO] Java Test Files AST scan
[INFO] 6 source files to be analyzed
[INFO] 6/6 source files have been analyzed
[INFO] Java Test Files AST scan (done) | time=334ms
[INFO] Sensor JavaSquidSensor (done) | time=21757ms
[INFO] Sensor PmdSensor
[INFO] Execute PMD 5.4.2...
[INFO] Java version: 1.7
[INFO] PMD configuration: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/sonar/pmd.xml
[INFO] PMD configuration: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/sonar/pmd-unit-tests.xml
[INFO] Execute PMD 5.4.2 done: 2375 ms
[INFO] Sensor PmdSensor (done) | time=2379ms
[INFO] Sensor CheckstyleSensor
[INFO] Execute Checkstyle 7.3...
[INFO] Checkstyle configuration: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/sonar/checkstyle.xml
[INFO] Checkstyle charset: UTF-8
[INFO] Execute Checkstyle 7.3 done: 1605 ms
[INFO] Sensor CheckstyleSensor (done) | time=1607ms
[INFO] Sensor SCM Sensor
[INFO] SCM provider for this project is: git
[INFO] 299 files to be analyzed
[INFO] 299/299 files analyzed
[INFO] Sensor SCM Sensor (done) | time=3669ms
[INFO] Sensor FindBugs Sensor
[INFO] Loading findbugs plugin: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/sonar/findbugs/fb-contrib.jar
[INFO] Loading findbugs plugin: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/sonar/findbugs/findsecbugs-plugin.jar
[INFO] Findbugs output report: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/sonar/findbugs-result.xml
The following classes needed for analysis were missing:
org.junit.runners.model.Statement
org.junit.Assert
org.assertj.core.api.Assertions
org.assertj.core.api.AbstractIntegerAssert
org.assertj.core.api.ListAssert
org.assertj.core.api.AbstractListAssert
org.junit.rules.TestRule
org.h2.Driver
org.assertj.core.groups.Tuple
[INFO] Sensor FindBugs Sensor (done) | time=23684ms
[INFO] Sensor SurefireSensor
[INFO] Property 'sonar.junit.reportsPath' is deprecated. Use property 'sonar.junit.reportPaths' instead.
[INFO] parsing [/workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/surefire-reports]
[INFO] Sensor SurefireSensor (done) | time=114ms
[INFO] Sensor JaCoCoSensor
[INFO] Analysing /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/jacoco.exec
[INFO] No information about coverage per test.
[INFO] Sensor JaCoCoSensor (done) | time=512ms
[INFO] Sensor JaCoCoItSensor
[INFO] JaCoCoItSensor: JaCoCo IT report not found: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/jacoco-it.exec
[INFO] Sensor JaCoCoItSensor (done) | time=0ms
[INFO] Sensor JaCoCoOverallSensor
[INFO] Analysing /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/jacoco.exec
[INFO] Analysing /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Services/target/sonar/jacoco-overall.exec
[INFO] No information about coverage per test.
[INFO] Sensor JaCoCoOverallSensor (done) | time=212ms
[INFO] Sensor SonarJavaXmlFileSensor
[INFO] Sensor SonarJavaXmlFileSensor (done) | time=2ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=119ms
[INFO] Sensor Code Colorizer Sensor
[INFO] Sensor Code Colorizer Sensor (done) | time=4ms
[INFO] Sensor CPD Block Indexer
[INFO] JavaCpdBlockIndexer is used for java
[INFO] Sensor CPD Block Indexer (done) | time=283ms
[INFO] ------------- Scan MP Web UI jenkins
[INFO] Base dir: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Webui
[INFO] Working dir: /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Webui/target/sonar
[INFO] Source paths: src/main/webapp, pom.xml, src/main/java
[INFO] Binary dirs: target/classes
[INFO] Source encoding: UTF-8, default locale: en_US
[INFO] Index files
[WARNING] Invalid character encountered in file /workspace/workspace/MP-pipeline_jenkins-HSMRPDPBA52NIJUTYCTAAM5Q76P4BDGNRHEXQ6VTGOHHOGM5XPRQ/Webui/src/main/webapp/js/my/widgets/templates/TutorialWidget.html at line 3 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
The only way to make it work is adding -Dsun.jnu.encoding=UTF-8 when doing the sonarqube analysis. Why does maven need this setting for the sonar-maven-plugin but not for anything else (like mvn clean install) ?
Related
I switched from windows to MacBook Air which is having M1 chip. I installed java and added the environment variables in .zprofile as follows
export JAVA_HOME=$(/usr/libexec/java_home)
export ANDROID_HOME=${HOME}/Library/Android/sdk
export PATH="${JAVA_HOME}/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}"
But when I run echo $JAVA_HOME, I see the output as /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home instead of /Library/Java/JavaVirtualMachines/jdk1.8.0_311.jdk/Contents/Home. I am not able to check if variable is set to JDK or JRE.
From Intellij, when I run mvn test clean, error is shown as,
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< org.example:SampleProject >----------------------
[INFO] Building SampleProject 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # SampleProject ---
[WARNING] Using platform encoding (US-ASCII actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # SampleProject ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # SampleProject ---
[WARNING] Using platform encoding (US-ASCII actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/moengage/IdeaProjects/SampleProject/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # SampleProject ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding US-ASCII, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Users/moengage/IdeaProjects/SampleProject/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.392 s
[INFO] Finished at: 2021-11-18T13:20:33+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project SampleProject: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR]
[ERROR] -> [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]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
Note: I checked others' questions as well and none of them were helpful. Can someone please help me in resolving this.
When SonarQube scans the Git submodule project, only the files of the super project are scanned.
Run in jenkins(Linux)
SonarQube version is 7.9.3
a maven project
the super project:
in other project,maven project have module,but not use git submodule can work.
the log:
only 1 file, the pom.xml for super project are scanned.
[INFO] User cache: /var/lib/jenkins/.sonar/cache
[INFO] SonarQube version: 7.9.3
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[WARNING] SonarScanner will require Java 11 to run starting in SonarQube 8.x
[INFO] Load global settings
[INFO] Load global settings (done) | time=86ms
[INFO] Server id: 0697A0C6-AXLFaD-v57HRhyHJwu5i
[INFO] User cache: /var/lib/jenkins/.sonar/cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=55ms
[INFO] Plugin [l10nzh] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
[INFO] Load/download plugins (done) | time=83ms
[INFO] Process project properties
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=5ms
[INFO] Project key: szyh_apps
[INFO] Base dir: /var/lib/jenkins/workspace/sonar/ ****
[INFO] Working dir: /var/lib/jenkins/workspace/sonar/ **** /target/sonar
[INFO] Load project settings for component key: 'szyh_apps'
[INFO] Load project settings for component key: 'szyh_apps' (done) | time=14ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=51ms
[INFO] Detected Jenkins
[INFO] Load active rules
[INFO] Load active rules (done) | time=567ms
[INFO] Indexing files...
[INFO] Project configuration:
[INFO] Indexing files of module '******'
[INFO] Base dir: /var/lib/jenkins/workspace/sonar/ ****
[INFO] Source paths: pom.xml, src/main/java
[INFO] Test paths: src/test/java
...
[INFO] Indexing files of module '****(the aggregator project)****'
[INFO] Base dir: /var/lib/jenkins/workspace/sonar/ ****
[INFO] Source paths: pom.xml
[INFO] 1 file indexed
[INFO] 0 files ignored because of scm ignore settings
[INFO] Quality profile for xml: Sonar way
[INFO] ------------- Run sensors on module ****
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=16ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] Sensor JavaXmlSensor [java] (done) | time=1ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
[INFO] ------------- Run sensors on module ****
[INFO] Sensor JavaXmlSensor [java]
[INFO] Sensor JavaXmlSensor [java] (done) | time=0ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
...
[INFO] Sensor MyBatisLint Sensor [mybatis]
[INFO] stmtIdExcludeList: []
[INFO] Sensor MyBatisLint Sensor [mybatis] (done) | time=78ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=16ms
[INFO] Sensor JavaXmlSensor [java] (done) | time=172ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=13ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=143ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 1/1 source files have been analyzed
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
[INFO] ------------- Run sensors on project
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=0ms
[INFO] SCM provider for this project is: git
[INFO] 1 files to be analyzed
[INFO] 1/1 files analyzed
[INFO] Calculating CPD for 0 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 70ms, dir size=191 KB
[INFO] Analysis report compressed in 9ms, zip size=16 KB
[INFO] Analysis report uploaded in 20ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http:// **** /dashboard?id=szyh_apps
[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:// **** /api/ce/task?id=****
[INFO] Analysis total time: 5.244 s
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
disabled scm can work, but no time and author information
mvn jacoco:prepare-agent sonar:sonar \
-Dsonar.projectKey=szyh_apps \
-Dsonar.host.url=http://**** \
-Dsonar.login=**** \
-Dsonar.scm.disabled \
-s /usr/share/maven/conf/settings-szyh_apps.xml
you can set -Dsonar.scm.exclusions.disabled=true in cmd line or
from SonarQube Dashboard->Administration->General settings->SCM->Disable the scm sensor=TRUE
This is working fine for me, I am using SonarQube V7.9.5
This is something related with how git is reading your repo.
first try cmd in you repository: git ls-tree -r HEAD
You can refer to Ann's answer :https://community.sonarsource.com/t/no-results-for-git-submodules/8464:
"""
Looking at the source of sonar-scm-git-plugin, I understand that actually it’s not strictly "adding exclusions based on project’s .gitignore", but instead it’s ignoring every file that’s not managed by the root repository.
You can verify this running git ls-tree -r HEAD in your git repo. The submodule’s files are not listed and basically this is what the Git Plugin 1.8 is doing.
"""
I have Jenkins to build my Java deployable and then push code into SonarQube for code scanning,
I am able to see the Bug report on SonarQube as well,
But I want a downloadable report in a PDF format or anything that can be shared after the scan.
I added the following properties in my project's pom.xml-
<properties>
<sonar.analysis.mode>preview</sonar.analysis.mode> <sonar.issuesReport.html.enable>true</sonar.issuesReport.html.enable>
</properties>
On my local Jenkins I have the following commands -
echo ** Executing SQ Analysis **
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.projectKey=Demo -Dsonar.sources=src/main/java -Dsonar.login=[someKey] -Dsonar.ProjectName=Demo -Dsonar.analysis.mode=preview -Dsonar.issuesReport.html.enable=true
I am getting the following error while trying to build -
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # Linear-ingestion ---
[INFO] Installing /home/user/.jenkins/workspace/Linear/target/Linear-ingestion-1.0-SNAPSHOT.jar to /home/user/.m2/repository/com/cloudlytics/Linear-ingestion/1.0-SNAPSHOT/Linear-ingestion-1.0-SNAPSHOT.jar
[INFO] Installing /home/user/.jenkins/workspace/Linear/pom.xml to /home/user/.m2/repository/com/cloudlytics/Linear-ingestion/1.0-SNAPSHOT/Linear-ingestion-1.0-SNAPSHOT.pom
[INFO] Installing /home/user/.jenkins/workspace/Linear/target/Linear-ingestion-1.0-SNAPSHOT-jar-with-dependencies.jar to /home/user/.m2/repository/com/cloudlytics/Linear-ingestion/1.0-SNAPSHOT/Linear-ingestion-1.0-SNAPSHOT-jar-with-dependencies.jar
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenArtifactArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenFingerprinter$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.531 s
[INFO] Finished at: 2018-07-04T13:41:08+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /home/user/.jenkins/workspace/Linear/pom.xml to com.cloudlytics/Linear-ingestion/1.0-SNAPSHOT/Linear-ingestion-1.0-SNAPSHOT.pom
[JENKINS] Archiving /home/user/.jenkins/workspace/Linear/target/Linear-ingestion-1.0-SNAPSHOT.jar to com.cloudlytics/Linear-ingestion/1.0-SNAPSHOT/Linear-ingestion-1.0-SNAPSHOT.jar
[JENKINS] Archiving /home/user/.jenkins/workspace/Linear/target/Linear-ingestion-1.0-SNAPSHOT-jar-with-dependencies.jar to com.cloudlytics/Linear-ingestion/1.0-SNAPSHOT/Linear-ingestion-1.0-SNAPSHOT-jar-with-dependencies.jar
[Linear] $ /bin/sh -xe /home/user/office/R&D/apache-tomcat-8.5.31/temp/jenkins3011322823073246601.sh
channel stopped
+ echo RemoteSystemsTempFiles bin log4j.properties pom.xml src target Executing SQ Analysis RemoteSystemsTempFiles bin log4j.properties pom.xml src target
RemoteSystemsTempFiles bin log4j.properties pom.xml src target Executing SQ Analysis RemoteSystemsTempFiles bin log4j.properties pom.xml src target
+ mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.projectKey=Linear -Dsonar.sources=src/main/java -Dsonar.login=f51956611fa53b292bb19e25752cb22b5afe893e -Dsonar.ProjectName=Linear sonar-runner -Dsonar.analysis.mode=preview -Dsonar.issuesReport.html.enable=true
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.cloudlytics:Linear-ingestion:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework:spring-core:jar -> version ${springframework.version} vs ${spring.version} # line 52, column 15
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework:spring-context:jar -> version ${springframework.version} vs ${org.springframework-version} # line 67, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------< com.cloudlytics:Linear-ingestion >------------------
[INFO] Building Linear-ingestion 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.4.1.1168:sonar (default-cli) # Linear-ingestion ---
[INFO] User cache: /home/user/.sonar/cache
[INFO] SonarQube version: 6.7.4
[INFO] Default locale: "en_IN", source code encoding: "UTF-8"
[INFO] Issues mode
[WARNING] The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the future.
[INFO] Load global settings
[INFO] Load global settings (done) | time=454ms
[INFO] Server id: AWRKrQutLb-E1SWiQK4O
[INFO] User cache: /home/user/.sonar/cache
[INFO] Exclude plugins: devcockpit, ldap, authgithub, authbitbucket, pdfreport, authaad, googleanalytics, governance
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=141ms
[INFO] Scanning only changed files
[INFO] Process project properties
[INFO] Load project repositories
[WARNING] Project doesn't exist on the server. All issues will be marked as 'new'.
[INFO] Load project repositories (done) | time=72ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=2536ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=1558ms
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=80ms
[INFO] Project key: Linear
[INFO] ------------- Scan Linear-ingestion
[INFO] Load server rules
[INFO] Load server rules (done) | time=804ms
[INFO] Base dir: /home/user/.jenkins/workspace/Linear
[INFO] Working dir: /home/user/.jenkins/workspace/Linear/target/sonar
[INFO] Source paths: src/main/java
[INFO] Source encoding: UTF-8, default locale: en_IN
[INFO] Index files
[INFO] 68 files indexed
[INFO] Quality profile for java: Sonar way
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 7
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=14ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=2ms
[INFO] Java Main Files AST scan
[INFO] 68 source files to be analyzed
[INFO] 45/68 files analyzed, current file: /home/user/.jenkins/workspace/Linear/src/main/java/com/blazeclan/sqs_polling_manager/xml/parser/dao/LogicallyDeleteDAO.java
[INFO] 68/68 source files have been analyzed
[INFO] Java Main Files AST scan (done) | time=12267ms
[INFO] Java Test Files AST scan
[INFO] 0 source files to be analyzed
[INFO] 0/0 source files have been analyzed
[INFO] Java Test Files AST scan (done) | time=3ms
[INFO] Sensor JavaSquidSensor [java] (done) | time=12972ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/home/user/.jenkins/workspace/Linear/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=3ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Sensor JaCoCoSensor [java] (done) | time=0ms
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms
[INFO] Sensor Analyzer for "php.ini" files [php]
[INFO] Sensor Analyzer for "php.ini" files [php] (done) | time=11ms
[INFO] Performing issue tracking
[INFO] 79/79 components tracked
[INFO] ANALYSIS SUCCESSFUL
[INFO] Task total time: 22.039 s
[INFO]
[INFO] ------------------< com.cloudlytics:Linear-ingestion >------------------
[INFO] Building Linear-ingestion 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.370 s
[INFO] Finished at: 2018-07-04T13:41:51+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "sonar-runner". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException
Build step 'Execute shell' marked build as failure
Finished: FAILURE
You want to execute unexistent sonar-runner goal:
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.projectKey=Demo -Dsonar.sources=src/main/java -Dsonar.login=[someKey] -Dsonar.ProjectName=Demo sonar-runner -Dsonar.analysis.mode=preview -Dsonar.issuesReport.html.enable=true
You have to remove it:
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.projectKey=Demo -Dsonar.sources=src/main/java -Dsonar.login=[someKey] -Dsonar.ProjectName=Demo -Dsonar.analysis.mode=preview -Dsonar.issuesReport.html.enable=true
I would recommended to remove more parameters:
sonar.projectKey - maven plugin is responsible for generating this parameter
sonar.ProjectName - doesn't exist (correct name is sonar.projectName), maven plugin will use vaule of name or artifactId nodes from your pom.xml file
sonar.sources=src/main/java - maven plugin is responsible for generating value of this parameter
sonar.analysis.mode=preview - deprecated and shouldn't be used (since 6.6, you use 6.7.4)
sonar.issuesReport.html.enable - Issues Report Plugin which uses this parameter is incompatible with SonarQube 6.7.4
Finally you can execute a simple and short command:
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=[someKey]
I'm trying to setup SonarQube.com on travis for a maven project, but I see the following exception on build:
[INFO] User cache: /home/travis/.sonar/cache
[INFO] Load global settings
[INFO] Load global settings (done) | time=456ms
[INFO] User cache: /home/travis/.sonar/cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=16ms
[INFO] Download sonar-scm-cvs-plugin-1.0.jar
[INFO] Download sonar-scm-svn-plugin-1.3.jar
[INFO] Download sonar-plsql-plugin-2.9.0.901.jar
[INFO] Download sonar-csharp-plugin-5.8.0.660.jar
[INFO] Download sonar-java-plugin-4.7.1.9272.jar
[INFO] Download sonar-web-plugin-2.5.0.476.jar
[INFO] Download sonar-flex-plugin-2.3.jar
[INFO] Download sonar-xml-plugin-1.4.2.885.jar
[INFO] Download sonar-vbnet-plugin-3.0.3.346.jar
[INFO] Download sonar-swift-plugin-2.0.0.1127.jar
[INFO] Download sonar-python-plugin-1.7.0.1195.jar
[INFO] Download sonar-github-plugin-1.4.0.699.jar
[INFO] Download sonar-cfamily-plugin-4.6.0.7071.jar
[INFO] Download sonar-auth-github-plugin-1.3.jar
[INFO] Download sonar-rpg-plugin-2.1.0.736.jar
[INFO] Download sonar-scm-mercurial-plugin-1.1.1.jar
[INFO] Download sonar-googleanalytics-plugin-1.1.jar
[INFO] Download sonar-widget-lab-plugin-1.8.1.jar
[INFO] Download sonar-pli-plugin-1.5.0.702.jar
[INFO] Download sonar-javascript-plugin-2.21.0.4409.jar
[INFO] Download sonar-groovy-plugin-1.4.jar
[INFO] Download sonar-cobol-plugin-3.3.1.1636.jar
[INFO] Download sonar-scm-git-plugin-1.2.jar
[INFO] Download sonar-php-plugin-2.10.0.2087.jar
[INFO] Download sonar-abap-plugin-3.3.jar
[INFO] Download sonar-governance-plugin-2.0.0.1789.jar
[INFO] Download qualinsight-sonarqube-badges-3.0.1.jar
[INFO] SonarQube version: 6.3.0
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:42 min
[INFO] Finished at: 2017-04-03T09:47:20+00:00
[INFO] Final Memory: 70M/468M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project jraft: No license for governance -> [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]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Here is the .travis.yml:
language: java
jdk:
- oraclejdk8
addons:
sonarqube:
organization: ${SONAR_ORGANIZATION}
token:
secure: ${SONAR_TOKEN}
script:
- ./travis.sh
cache:
directories:
- $HOME/.m2/repository
- $HOME/.sonar
- $HOME/jvm
- $HOME/maven
Here is the travis.sh:
#!/bin/bash
set -e
INITIAL_VERSION=1.0-SNAPSHOT
export MAVEN_OPTS="-Xmx1G -Xms128m"
mvn package sonar:sonar \
$MAVEN_ARGS \
-Dsonar.host.url=$SONAR_HOST_URL \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.projectVersion=$INITIAL_VERSION
Why I am seeing this error No license for governance as I am not using any commercial sonar component (only sonar-java I suppose)?
The problem seems to be related to the fact that one of the plugins needs a commercial key, but How I can tell Travis to only install the java plugin?
Taking a look at your repository, you should not override the various parameters that the Travis Add-on is specifying for you.
More specifically, when you override SONAR_TOKEN on the Maven command line (at line 12), the consequence is that the token that you have encrypted and passed at line 11 of your .travis.yml file is completely wiped out. Because of this, your analysis is run like if you were anonymous.
So please follow the Get Started guide and simply run the following Maven command:
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar
sonar-governance plugin is commercial plugin.
check here
.....
[INFO] Download sonar-governance-plugin-2.0.0.1789.jar
......
For me the below works from my jenkins pipeline
node{
stage 'Code Quality'
sh "mvn sonar:sonar -Dsonar.host.url=http://<hostname>:9000"
}
I am using Maven with the Cobertura and SonarQube plug-ins. I want the results in cobertura.ser to be uploaded to SonarQube. This is my pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>delta.coverage.mvp</groupId>
<artifactId>delta.coverage.mvp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<sonar.host.url>http://192.168.1.10:9000</sonar.host.url>
<sonar.jdbc.driverClassName>org.h2.Driver</sonar.jdbc.driverClassName>
<sonar.language>java</sonar.language>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.login>admin</sonar.login>
<sonar.password>adminpwd</sonar.password>
<sonar.projectKey>delta.coverage.mvp</sonar.projectKey>
<sonar.projectName>delta.coverage.mvp</sonar.projectName>
<sonar.projectVersion>test</sonar.projectVersion>
<sonar.sources>src/main/java</sonar.sources>
<sonar.java.coveragePlugin>cobertura</sonar.java.coveragePlugin>
<sonar.junit.reportsPath>${project.basedir}/target/surefire-reports</sonar.junit.reportsPath>
<sonar.surefire.reportsPath>${project.basedir}/target/surefire-reports</sonar.surefire.reportsPath>
<sonar.cobertura.reportPath>${project.basedir}/target/cobertura/cobertura.ser</sonar.cobertura.reportPath>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<instrumentation>
<includes>
<include>**/*.class</include>
</includes>
</instrumentation>
</configuration>
<executions>
<execution>
<id>clean</id>
<phase>pre-site</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
<execution>
<id>instrument</id>
<phase>site</phase>
<goals>
<goal>instrument</goal>
<goal>cobertura</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- SonarQube Plugin -->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.0.2</version>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<!-- use mvn cobertura:cobertura to generate cobertura reports -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</reporting>
</project>
I am running mvn clean cobertura:cobertura sonar:sonar in order to build, unit-test (with coverage) and analyze the code+upload the unit test results. The analysis (SonarQube scan) is uploaded successfully. However, the Cobertura results are not uploaded to SonarQube. Instead, the log shows that Maven actually looked for JaCoCo files:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building delta.coverage.mvp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # delta.coverage.mvp ---
[INFO] Deleting /home/phil/git/delta-coverage-mvp/target
[INFO]
[INFO] >>> cobertura-maven-plugin:2.7:cobertura (default-cli) > [cobertura]test # delta.coverage.mvp >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # delta.coverage.mvp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # delta.coverage.mvp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/phil/git/delta-coverage-mvp/target/classes
[INFO]
[INFO] --- cobertura-maven-plugin:2.7:instrument (default-cli) # delta.coverage.mvp ---
[INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Cobertura: Saved information on 1 classes.
[INFO] Cobertura: Saved information on 1 classes.
[INFO] Instrumentation was successful.
[INFO] NOT adding cobertura ser file to attached artifacts list.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # delta.coverage.mvp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # delta.coverage.mvp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/phil/git/delta-coverage-mvp/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # delta.coverage.mvp ---
[INFO] Surefire report directory: /home/phil/git/delta-coverage-mvp/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running delta.coverage.mvp.package1.Test1
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.202 sec
[INFO] Cobertura: Loaded information on 1 classes.
[INFO] Cobertura: Saved information on 1 classes.
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] <<< cobertura-maven-plugin:2.7:cobertura (default-cli) < [cobertura]test # delta.coverage.mvp <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.7:cobertura (default-cli) # delta.coverage.mvp ---
[INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Cobertura: Loaded information on 1 classes.
Report time: 108ms
[INFO] Cobertura Report generation was successful.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building delta.coverage.mvp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.0.2:sonar (default-cli) # delta.coverage.mvp ---
[INFO] User cache: /home/phil/.sonar/cache
[INFO] Load global repositories
[INFO] Load global repositories (done) | time=517ms
[INFO] User cache: /home/phil/.sonar/cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=116ms
[INFO] SonarQube version: 5.6.1
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Process project properties
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=193ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=143ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=1824ms
[WARNING] 'sonar.dynamicAnalysis' is deprecated since version 4.3 and should no longer be used.
[INFO] Publish mode
[INFO] ------------- Scan delta.coverage.mvp
[INFO] Language is forced to java
[INFO] Load server rules
[INFO] Load server rules (done) | time=966ms
[INFO] Base dir: /home/phil/git/delta-coverage-mvp
[INFO] Working dir: /home/phil/git/delta-coverage-mvp/target/sonar
[INFO] Source paths: src/main/java
[INFO] Test paths: src/test/java
[INFO] Binary dirs: target/classes
[INFO] Source encoding: UTF-8, default locale: en_US
[INFO] Index files
[INFO] 2 files indexed
[INFO] Quality profile for java: Cloud Managed Services - 201503
[INFO] JaCoCoSensor: JaCoCo report not found : /home/phil/git/delta-coverage-mvp/target/jacoco.exec
[INFO] JaCoCoItSensor: JaCoCo IT report not found: /home/phil/git/delta-coverage-mvp/target/jacoco-it.exec
[INFO] Sensor JavaSquidSensor
[INFO] Configured Java source version (sonar.java.source): none
[INFO] JavaClasspath initialization...
[INFO] JavaClasspath initialization done: 12 ms
[INFO] JavaTestClasspath initialization...
[INFO] JavaTestClasspath initialization done: 4 ms
[INFO] Java Main Files AST scan...
[INFO] 1 source files to be analyzed
[INFO] Java Main Files AST scan done: 193 ms
[INFO] 1/1 source files have been analyzed
[INFO] Java bytecode scan...
[INFO] Java bytecode scan done: 18 ms
[INFO] Java Test Files AST scan...
[INFO] 1 source files to be analyzed
[INFO] Java Test Files AST scan done: 56 ms
[INFO] 1/1 source files have been analyzed
[INFO] Package design analysis...
[INFO] Package design analysis done: 4 ms
[INFO] Sensor JavaSquidSensor (done) | time=560ms
[INFO] Sensor Lines Sensor
[INFO] Sensor Lines Sensor (done) | time=1ms
[INFO] Sensor SurefireSensor
[INFO] parsing /home/phil/git/delta-coverage-mvp/target/surefire-reports
[INFO] Sensor SurefireSensor (done) | time=54ms
[INFO] Sensor SCM Sensor
[INFO] SCM provider for this project is: git
[INFO] 2 files to be analyzed
[INFO] 0/2 files analyzed
[WARNING] Missing blame information for the following files:
[WARNING] * /home/phil/git/delta-coverage-mvp/src/main/java/delta/coverage/mvp/package1/Class1.java
[WARNING] * /home/phil/git/delta-coverage-mvp/src/test/java/delta/coverage/mvp/package1/Test1.java
[WARNING] This may lead to missing/broken features in SonarQube
[INFO] Sensor SCM Sensor (done) | time=112ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=5ms
[INFO] Sensor Code Colorizer Sensor
[INFO] Sensor Code Colorizer Sensor (done) | time=1ms
[INFO] Sensor CPD Block Indexer
[INFO] JavaCpdBlockIndexer is used for java
[INFO] Sensor CPD Block Indexer (done) | time=159ms
[INFO] Calculating CPD for 1 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 57ms, dir size=13 KB
[INFO] Analysis reports compressed in 14ms, zip size=8 KB
[INFO] Analysis report uploaded in 218ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://192.168.1.10:9000/dashboard/index/delta.coverage.mvp
[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://192.168.1.10:9000/api/ce/task?id=AVbYSBOBTyY3I5vbl2iO
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.175 s
[INFO] Finished at: 2016-08-29T16:50:17-05:00
[INFO] Final Memory: 31M/666M
[INFO] ------------------------------------------------------------------------
The problem was that the the Cobertura plug-in on the SQ server was not installed. I installed it and everything worked fine.
Unfortunately nothing in the mvn log showed that Cobertura was invoked, and I assumed that the SQ server would support Cobertura by default since it's one of the main coverage tools for Java. Very counter-intuitive, but at least there is a simple solution.