cd Project_Source
cd configs
mkdir build-sonarqube
cd build-sonarqube
cmake ..
cd ..
build-wrapper-linux-x86-64 --out-dir bw-output cmake --build build-sonarqube/ --config Release
sonar-scanner -Dsonar.projectKey=... -Dsonar.cfamily.build-wrapper-output=bw-output -Dsonar.host.url=http://... -Dsonar.login=....
Before this editing, the files in the “configs” folder were placed under “project_source” and analysis output was obtained without any problems. Since I wanted to ensure code integrity and keep it in a separate place, I wanted to analyze it by taking it to a subfolder (of course, I rearranged the relative and absolute paths) but as a result, 0 files were analyzed.
The analysis is a success, but the number of scanned files shows 0, what exactly is the reason for this?
You will need to initiate the scan from the root directory you want to scan. If you can’t keep the sonar-project.properties file there, you should point to it as documented
The property project.settings can be used to specify the path to the project configuration file (this option is incompatible with the sonar.projectBaseDir property). Ex:
It’s one option – or take the other option suggested and use -Dproject.settings to point to the properties file in the subdirectory, while still initiating the scan from the root of the project.