sonar.projectBaseDir doesn't work

Must-share information
SonarQube community edition version 8.8 (build 42792)
how is SonarQube deployed: Jenkins

Hello everyone

I’m trying to run sonarqube analisys with Jenkins
We use multi scm project, and since sonarqube doesn’t support multi scm analisys(with scm integration), i’m trying to run it on certain repo

Our project consists of folders, so basicly it looks like

  • jenkins_folder
    |-- workspace
    –|-- sonarqube
    –|–|-- project 1 (repo 1)
    –|–|–|-- .git
    –|–|–|-- files to analyse
    –|–|-- project 2 (repo 2)
    –|–|–|-- .git
    –|–|–|-- files to analyse

Analisys run in root folder by default and i get “root Not inside a Git work tree”
So I decided to run analisys on project 1 and set sonar.projectBaseDir=/jenkins_folder/workspace/sonarqube/project 1
And I got error:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project: Not inside a Git work tree: C:\jenkins_folder\workspace\sonarqube

And in logs there is:
[INFO] Base dir: C:\jenkins_folder\workspace\sonarqube

So setting projectBaseDir doesn’t work, it’s still root folder and I can’t get what to do about it

Tell pls, what am I doing wrong, and how to solve this problem


Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.9 → 8.9.10 → 9.9 → 10.0 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes for 7.9 to 8.9, as well as the LTS to LTS release upgrade notes for 8.9 to 9.9 helpful. If you have questions about upgrading, feel free to open a new thread for that here.

Regarding your question, you should cd into project 1 before you run analysis.


thanks a bunch, but why does one need to cd to another folder, if there is a way to set the analysis to begin from certain folder?

The main quesition is why doesn’t base dir change, how does cd should make any change?


Analysis expects to be kicked off from the project root.


Nothing’s working. Not cd, nor dir command in pipeline
I don’t know what can I do else, counting on you, hope you can give some advice


My first advice is to upgrade. Then come back and we can go from there.