I am facing a problem in one of our gitlab-ci build steps, where SonarQ is executed via maven plugin. It happens on a merge request / pull request when the target branch is not master, but another branch like the ‘release branch’. Inspecting the console output, it is stating that the blame information is missing on the changed fileset of the feature branch. Finally, the analysis was not running and the build step failed.
Below you can find error log snippets including SonarQ version and plugin version.
[INFO] SonarQube version: 9.7.1.62043
...
[WARNING] Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'.
[INFO] SCM Publisher 0/1 source files have been analyzed (done) | time=5ms
[WARNING] Missing blame information for the following files:
[WARNING] * /src/test/java/xxx/aclass.java
[WARNING] This may lead to missing/broken features in SonarQube
...
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project project: CE Task finished abnormally with status: FAILED, you can check details here: https://host/api/ce/task?id=AYqspPQOhBERMgJMkSH0 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project project: CE Task finished abnormally with status: FAILED, you can check details here: https://host/api/ce/task?id=AYqspPQOhBERMgJMkSH0
Content of https://host/api/ce/task?id=AYqspPQOhBERMgJMkSH0:
{"task":{"id":"AYqspPQOhBERMgJMkSH0","type":"REPORT","componentId":"AYqspDVQhBERMgJMkSHx","componentKey":"xxx:project","componentName":"project","componentQualifier":"TRK","status":"FAILED","submittedAt":"2023-09-19T08:53:26+0000","submitterLogin":"apim-sonarlint","startedAt":"2023-09-19T08:53:27+0000","executedAt":"2023-09-19T08:53:28+0000","executionTimeMs":1730,"errorMessage":"Fail to process issues of component \u0027xxx:project:/src/test/java/xxx/aclass.java\u0027 (Visit of Component {key\u003dxxx:project/src/test/java/xxx/aclass.java,type\u003dFILE} failed)","hasScannerContext":true,"pullRequest":"185","warningCount":3,"warnings":[]}}
If you need more information, please let me know.
Thanks in advance for your help.
Kind regards, Sven