Source vs sonar.projectBaseDir

SonarQube Enterprise 9.9, Scanner CLI, deploy using gitLab

I have a project that I am scanning. I do not have control over the way it is structured but I am using the dependency-check plugin to scan my libraries. The output path for the report target/scala-2.13/
But because I don’t have a src/main/scala and the project directory is under code folder. I get an error on SonarQube because the path ends up being /code/target/scala-2.13 which leads to not found, due to using projectBaseDir. The report is being outputted to the root /target/scala-2.13/

Is there any way I can accommodate this?

Hi Jack,

Does your project or gitlab pipeline have a report path parameter configured such as what’s documented here?

I am currently saving the artifacts in gitLab pipeline. The artifacts also save to the root/target/ folder. But to answer that question, I am not using a CI/CD variable.

I believe the same error would occur because of the declaration of projectBaseDir. Which makes Sonar CLI look in root/code/target is there any work around for this?

I figured it out by using ../ before my path.

1 Like