Sonar Project BaseDir

Hello,

We do use a SonarQube Community Edition Version 8.9.9 (build 56886).
I would like to define in the sonar-project.properties file a sonar.projectBaseDir to another Git Repository. I already tried to define the full Git URL, like:

# Scan settings.
sonar.projectBaseDir=https://***/group1/group2/project/-/tree/develop

But I am running to the following error:

ERROR: Error during SonarScanner execution

[50](https://***/group1/group2/project/pipeline/-/jobs/70053040#L50)java.lang.IllegalStateException: Project home must be an existing directory:

Is there a way to define another Git repository for the project base dir?
Thanks

Hey there.

No, you can’t provide a URL here.

Why not start the analysis directly from that checked-out repo?

Hey Colin,
thanks for the answer.
The original repo is a mirror from external company and they do not want to implement Sonar. Therefore we have another project with pipeline which deploys the application and here in this pipeline we wanted to implement the Sonar. So there is no way to scan a foreign repo?
Thanks a lot.
Csaba

Hey community,

is there someone who faced with a same issue? Or is there a way to scan a foreign repo?
Thanks a lot

Hey there.

You really just need to run a git clone on that repo (assuming you have access to it) and then start the analysis from inside that repository.

Now – if for some reason you don’t have access to that Git repository – there’s no way your pipeline or the sonarqube scanner would have access either.

In summary – if you have access to that repo, perform your typical git clone and run the analysis. Don’t reference anything within the scanner properties.