Hope you are in good health.
Must-share information (formatted with Markdown):
- which versions are you using (SonarQube Scanner 4.0.0.1744)
- what are you trying to achieve: trying to run the scanner with Jenkins deployment
In most case that I see people have issues with having unknown sonar.project.key i see they have NONE in the project file but mine detects it but still throws the error:
[ Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: Jenkins-sonar-server
[Pipeline] {
[Pipeline] sh
+ /opt/sonar_scanner/sonar-scanner-4.0.0.1744-linux/bin/sonar-scanner
INFO: Scanner configuration file: /opt/sonar_scanner/sonar-scanner-4.0.0.1744-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/bitnami/jenkins/workspace/test-deployment/sonar-project.properties
INFO: SonarQube Scanner 4.0.0.1744
INFO: Java 11.0.9.1 Debian (64-bit)
INFO: Linux 4.19.0-9-cloud-amd64 amd64
INFO: User cache: /home/bitnami/.sonar/cache
INFO: SonarQube server 8.3.1
INFO: Default locale: âen_USâ, source code encoding: âUTF-8â (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=163ms
INFO: Server id: 86E1FA4D-AXim13wYREtv62J3eWMe
INFO: User cache: /home/bitnami/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=88ms
INFO: Load/download plugins (done) | time=341ms
INFO: Process project properties
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 3.525s
INFO: Final Memory: 6M/27M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
ERROR: You must define the following mandatory properties for âUnknownâ: sonar.projectKey
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
[Pipeline] }
WARN: Unable to locate âreport-task.txtâ in the workspace. Did the SonarScanner succeed?
[Pipeline] // withSonarQubeEnv
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
[Checks API] No suitable checks publisher found.
ERROR: script returned exit code 2
Finished: FAILURE