Must-share information (formatted with Markdown):
-
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
-
SonarQube Version 9.3 (build 51899)
-
Jenkins 2.346.2 (https://www.jenkins.io/)
-
maven-3.6.3
-
org.sonarsource.scanner.maven:sonar-maven-plugin:jar:3.9.1.2184
-
Pull request based SonarQube analysis
-
launching the PR analysis through mvn command
mvn sonar:sonar -X -Dsonar.verbose=true -Dsonar.java.source=8 -Dsonar.projectKey=PRJ_XYZ -Dsonar.pullrequest.key=107 -Dsonar.pullrequest.branch=feature/badcode -Dsonar.pullrequest.base=master
In the logs, we notice that the PR pull request is recognized against the correct source and target branches. But, the SCM somehow only shows 0 changed files even though there is a one changed file.
[INFO] 15:00:00.586 Pull request 107 for merge into master from feature/badcode
[INFO] 15:00:00.605 SCM collecting changed files in the branch
[INFO] 15:00:00.762 Merge base sha1: 4b548fb41005805e5c0aca462732efbda0cf78b0
[INFO] 15:00:00.790 SCM collecting changed files in the branch (done) | time=187ms
[DEBUG] 15:00:00.791 SCM reported 0 files changed in the branch