Sonar.sources not getting picked up

We have a project that was structured like so:

my-app/
├─ bar/
│  ├─ sonar-project.properties
├─ foo/
│  ├─ sonar-project.properties
├─ sonar-project.properties

We’ve moved all of the packages (foo and bar in this case) to a new packages directory, like so:

my-app/
├─ packages/
│  ├─ bar/
│  │  ├─ sonar-project.properties
│  ├─ foo/
│  │  ├─ sonar-project.properties
├─ sonar-project.properties

When we run Sonar scans run in our CI environment, I get this output

07:15:35 [xx-xx-master] $ /home/xxxxxxx/sonar-cli-5.0.1/bin/sonar-scanner -Dsonar.host.url=https://xxxx.com ********  -Dsonar.projectBaseDir=/home/xxxxxxx/workspace/xx-xx-master
07:15:35 INFO: Scanner configuration file: /home/xxxxxxx/sonar-cli-5.0.1/conf/sonar-scanner.properties
07:15:35 INFO: Project root configuration file: /home/xxxxxxx/workspace/xx-xx-master/sonar-project.properties
07:15:35 INFO: ------------------------------------------------------------------------
07:15:35 INFO: EXECUTION FAILURE
07:15:35 INFO: ------------------------------------------------------------------------
07:15:35 INFO: Total time: 0.017s
07:15:35 INFO: Final Memory: 8M/80M
07:15:35 INFO: ------------------------------------------------------------------------
07:15:35 ERROR: Error during SonarScanner execution
07:15:35 java.lang.IllegalStateException: The base directory of the module 'bar' does not exist: /home/xxxxxxx/workspace/xx-xx-master/bar
07:15:35 	at org.sonarsource.scanner.cli.Conf.setModuleBaseDir(Conf.java:195)
07:15:35 	at org.sonarsource.scanner.cli.Conf.loadModuleConfigFile(Conf.java:187)
07:15:35 	at org.sonarsource.scanner.cli.Conf.loadModulesProperties(Conf.java:152)
07:15:35 	at org.sonarsource.scanner.cli.Conf.loadProjectProperties(Conf.java:126)
07:15:35 	at org.sonarsource.scanner.cli.Conf.properties(Conf.java:60)
07:15:35 	at org.sonarsource.scanner.cli.Main.execute(Main.java:70)
07:15:35 	at org.sonarsource.scanner.cli.Main.main(Main.java:62)
07:15:35 ERROR: 
07:15:35 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

I’ve run with the -X switch, as well as -Dsonar.log.level=DEBUG. Neither of these switches did anything.

I initially tried setting sonar.projectBaseDir=packages in the root config file, but then realized that wasn’t what I wanted. So I tried sonar.sources=packages. I feel that should have worked. What can I try next? How can I actually get debug output?

SonarQube v9.9.4 (build 87374)
I think it’s deployed via Docker. I can check if this fact is really important

Thanks in advance!

I forgot to mention our configuration. The root sonar-project.properties file is:

sonar.projectKey=com.xxx.xxxx.xx.xx:xx-xx
sonar.projectName=xx-xx
sonar.projectVersion=22.6.0
sonar.sources=packages
sonar.language=js
sonar.host.url=https://xxxxxx
sonar.modules=foo,bar

And the individual project property files are like:

sonar.projectName=foo
sonar.sources=addon
sonar.javascript.lcov.reportPaths=coverage/lcov.info

Sorry for all the noise. Once I got rid of sonar.modules, it worked.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.