Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- what are you trying to achieve - trying to execute sonarqube analysis using Maven from build pipeline.
- what have you tried so far to achieve this
sonarqube version is 7.9.3
running build pipeline using maven.
Here is the log
2021-06-17T11:24:20.7605950Z ##[section]Starting: Maven
2021-06-17T11:24:20.7998240Z ==============================================================================
2021-06-17T11:24:20.7998691Z Task : Maven
2021-06-17T11:24:20.7999025Z Description : Build, test, and deploy with Apache Maven
2021-06-17T11:24:20.7999328Z Version : 3.186.0
2021-06-17T11:24:20.7999667Z Author : Microsoft Corporation
2021-06-17T11:24:20.8000053Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/maven
2021-06-17T11:24:20.8000462Z ==============================================================================
2021-06-17T11:24:21.6575588Z [command]C:\windows\system32\cmd.exe /D /S /C "C:\opt\apache-maven-3.6.3\bin\mvn.cmd -version"
2021-06-17T11:24:22.0259979Z Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
2021-06-17T11:24:22.0262821Z Maven home: C:\opt\apache-maven-3.6.3\bin\..
2021-06-17T11:24:22.0265308Z Java version: 1.8.0_275, vendor: AdoptOpenJDK, runtime: C:\Program Files\AdoptOpenJDK\jdk-8.0.275.1-hotspot\jre
2021-06-17T11:24:22.0268017Z Default locale: en_US, platform encoding: Cp1252
2021-06-17T11:24:22.0269234Z OS name: "windows server 2016", version: "10.0", arch: "amd64", family: "windows"
2021-06-17T11:24:22.0676116Z [command]C:\windows\system32\cmd.exe /D /S /C "C:\opt\apache-maven-3.6.3\bin\mvn.cmd -f c:\agent2\_work\5\s\pom.xml package sonar:sonar org.sonarsource.scanner.maven:sonar-maven-plugin:RELEASE:sonar"
2021-06-17T11:24:23.8303614Z [INFO] Scanning for projects...
2021-06-17T11:24:26.2196454Z [INFO]
2021-06-17T11:24:26.2197780Z [INFO] -----------------------< com.mycompany:hellosai >-----------------------
2021-06-17T11:24:26.2198862Z [INFO] Building helloSQ 1.0.0-SNAPSHOT
2021-06-17T11:24:26.2199671Z [INFO] --------------------------[ mule-application ]--------------------------
2021-06-17T11:24:26.2200381Z [INFO]
2021-06-17T11:24:26.2201063Z [INFO] --- mule-maven-plugin:3.4.2:validate (default-validate) @ hellosai ---
2021-06-17T11:24:26.2201640Z [INFO]
2021-06-17T11:24:26.2202399Z [INFO] --- mule-maven-plugin:3.4.2:initialize (default-initialize) @ hellosai ---
2021-06-17T11:24:26.2202979Z [INFO]
2021-06-17T11:24:26.2203569Z [INFO] --- mule-maven-plugin:3.4.2:generate-sources (default-generate-sources) @ hellosai ---
2021-06-17T11:24:26.4894389Z [INFO]
2021-06-17T11:24:26.4895430Z [INFO] --- mule-maven-plugin:3.4.2:process-sources (default-process-sources) @ hellosai ---
2021-06-17T11:24:27.7723212Z [INFO] About to fetch required dependencies for artifact: com.mycompany:hellosai:pom:1.0.0-SNAPSHOT. This may take a while...
2021-06-17T11:24:27.7724215Z [INFO]
2021-06-17T11:24:27.7724827Z [INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ hellosai ---
2021-06-17T11:24:27.7725399Z [INFO] Using 'UTF-8' encoding to copy filtered resources.
2021-06-17T11:24:27.7725987Z [INFO] Copying 1 resource
2021-06-17T11:24:27.7726414Z [INFO]
2021-06-17T11:24:27.7726840Z [INFO] --- mule-maven-plugin:3.4.2:process-resources (default-process-resources) @ hellosai ---
2021-06-17T11:24:27.7727920Z [INFO]
2021-06-17T11:24:27.7728496Z [INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ hellosai ---
2021-06-17T11:24:27.7729007Z [INFO] No sources to compile
2021-06-17T11:24:27.7729348Z [INFO]
2021-06-17T11:24:27.7729785Z [INFO] --- mule-maven-plugin:3.4.2:compile (default-compile) @ hellosai ---
2021-06-17T11:24:27.7731375Z [INFO]
2021-06-17T11:24:27.7731826Z [INFO] --- mule-maven-plugin:3.4.2:process-classes (default-process-classes) @ hellosai ---
2021-06-17T11:24:27.7732265Z [INFO]
2021-06-17T11:24:27.7732993Z [INFO] --- mule-maven-plugin:3.4.2:generate-test-sources (default-generate-test-sources) @ hellosai ---
2021-06-17T11:24:27.7742434Z [INFO]
2021-06-17T11:24:27.7743073Z [INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ hellosai ---
2021-06-17T11:24:27.7743609Z [INFO] Using 'UTF-8' encoding to copy filtered resources.
2021-06-17T11:24:27.7743970Z [INFO] Copying 1 resource
2021-06-17T11:24:27.7745858Z [INFO]
2021-06-17T11:24:27.7747115Z [INFO] --- mule-maven-plugin:3.4.2:generate-test-resources (default-generate-test-resources) @ hellosai ---
2021-06-17T11:24:27.7747826Z [INFO]
2021-06-17T11:24:27.7748262Z [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ hellosai ---
2021-06-17T11:24:27.7749039Z [INFO] No sources to compile
2021-06-17T11:24:27.7749364Z [INFO]
2021-06-17T11:24:27.7749770Z [INFO] --- mule-maven-plugin:3.4.2:test-compile (default-test-compile) @ hellosai ---
2021-06-17T11:24:27.7750150Z [INFO]
2021-06-17T11:24:27.7750562Z [INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ hellosai ---
2021-06-17T11:24:27.9627830Z [INFO]
2021-06-17T11:24:27.9635401Z [INFO] --- mule-maven-plugin:3.4.2:package (default-package) @ hellosai ---
2021-06-17T11:24:27.9840782Z [INFO] Building zip: c:\agent2\_work\5\s\target\hellosai-1.0.0-SNAPSHOT-mule-application.jar
2021-06-17T11:24:28.7474104Z [INFO]
2021-06-17T11:24:28.7474757Z [INFO] -----------------------< com.mycompany:hellosai >-----------------------
2021-06-17T11:24:28.7475483Z [INFO] Building helloSQ 1.0.0-SNAPSHOT
2021-06-17T11:24:28.8817810Z [INFO] --------------------------[ mule-application ]--------------------------
2021-06-17T11:24:28.8820620Z [INFO]
2021-06-17T11:24:28.8821575Z [INFO] --- sonar-maven-plugin:3.9.0.2155:sonar (default-cli) @ hellosai ---
2021-06-17T11:24:29.2380801Z [INFO] User cache: C:\Windows\ServiceProfiles\NetworkService\.sonar\cache
2021-06-17T11:24:29.5336993Z [INFO] SonarQube version: 7.9.3
2021-06-17T11:24:29.5578428Z [INFO] Default locale: "en_US", source code encoding: "UTF-8"
2021-06-17T11:24:29.7853561Z [WARNING] SonarScanner will require Java 11 to run starting in SonarQube 8.x
2021-06-17T11:24:30.0823212Z [INFO] Load global settings
2021-06-17T11:24:30.2531668Z [INFO] Load global settings (done) | time=172ms
2021-06-17T11:24:30.2533221Z [INFO] Server id: 079D80A9-AXhfU2SKZm9E6JoGzHeX
2021-06-17T11:24:30.2786807Z [INFO] User cache: C:\Windows\ServiceProfiles\NetworkService\.sonar\cache
2021-06-17T11:24:30.2789735Z [INFO] Load/download plugins
2021-06-17T11:24:30.2790719Z [INFO] Load plugins index
2021-06-17T11:24:30.3854725Z [INFO] Load plugins index (done) | time=62ms
2021-06-17T11:24:30.8796539Z [INFO] Load/download plugins (done) | time=234ms
2021-06-17T11:24:31.0105076Z [INFO] Loaded core extensions: developer-scanner
2021-06-17T11:24:31.6677679Z [INFO] Process project properties
2021-06-17T11:24:31.6684674Z [INFO] Execute project builders
2021-06-17T11:24:31.6685586Z [INFO] Execute project builders (done) | time=15ms
2021-06-17T11:24:31.6686192Z [INFO] Project key: PG-CloudIntegration
2021-06-17T11:24:31.6686746Z [INFO] Base dir: C:\agent2\_work\5\s
2021-06-17T11:24:31.6687368Z [INFO] Working dir: c:\agent2\_work\5\s\target\sonar
2021-06-17T11:24:31.7589563Z [INFO] Load project settings for component key: 'PG-CloudIntegration'
2021-06-17T11:24:31.8483439Z [INFO] Load project branches
2021-06-17T11:24:31.8559057Z [INFO] Load project branches (done) | time=16ms
2021-06-17T11:24:31.8565200Z [INFO] Load project pull requests
2021-06-17T11:24:31.8651198Z [INFO] Load project pull requests (done) | time=0ms
2021-06-17T11:24:31.8651684Z [INFO] Load branch configuration
2021-06-17T11:24:31.8785135Z [INFO] ------------------------------------------------------------------------
2021-06-17T11:24:31.8787059Z [INFO] BUILD FAILURE
2021-06-17T11:24:31.8846997Z [INFO] ------------------------------------------------------------------------
2021-06-17T11:24:31.8847537Z [INFO] Total time: 8.079 s
2021-06-17T11:24:31.8848008Z [INFO] Finished at: 2021-06-17T13:24:31+02:00
2021-06-17T11:24:31.8848548Z [INFO] ------------------------------------------------------------------------
2021-06-17T11:24:31.8849536Z [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project hellosai: Project was never analyzed. A regular analysis is required before a branch analysis -> [Help 1]
2021-06-17T11:24:31.8851450Z [ERROR]
2021-06-17T11:24:31.8851848Z [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
2021-06-17T11:24:31.8852354Z [ERROR] Re-run Maven using the -X switch to enable full debug logging.
2021-06-17T11:24:31.8852718Z [ERROR]
2021-06-17T11:24:31.8853215Z [ERROR] For more information about the errors and possible solutions, please read the following articles:
2021-06-17T11:24:31.8853863Z [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
2021-06-17T11:24:32.4776821Z The process 'C:\opt\apache-maven-3.6.3\bin\mvn.cmd' failed with exit code 1
2021-06-17T11:24:32.4936175Z Could not retrieve code analysis results - Maven run failed.
2021-06-17T11:24:32.6119493Z No test result files matching c:\agent2\_work\5\s\**\surefire-reports\TEST-*.xml were found, so publishing JUnit test results is being skipped.
2021-06-17T11:24:32.6164378Z ##[error]Build failed.
2021-06-17T11:24:32.6231290Z ##[section]Finishing: Maven
Can anyone help on this?