Property "sonar.cfamily.build-wrapper-output" was not specified


(Josh) #1

Hello,

I’m scanning a project that is partially C# and partially C++. They both compile as part of our VisualStudio 2017 project, or when running MSBuild.exe at the command line.

When scanning with SonarQube, I get this error even though it seems to compile the C++ files fine. Also, I’m using the enterprise edition that has the C++ extension.

When searching on this error, I came to the following website, but the instructions are very confusing and they seem to imply a different process then the standard scanning process.
https://docs.sonarqube.org/display/PLUG/Building+on+Windows

Here’s the process I’m using to scan:

  1. SonarScanner.MSBuild.exe begin /k:mySonarQubeProject /d:sonar.host.url=http://localhost:9000
    /d:sonar.login=abc123

  2. MSBuild.exe myVisualStudioProject.sln /t:Rebuild

  3. SonarScanner.MSBuild.exe end /d:sonar.login=abc123

My big question is how to I incorporate whatever I’m supposed to do into this standard process.

Note that I’ve tried downloading build-wrapper-win-x86-64.exe from the server though I’m not exactly sure what to do with it. I’ve also tried modifying sonar.properties to include:
sonar.cfamily.build-wrapper-output.bypass=true
but this has no effect. Note that I modified the file “sonarqube-6.7.4\conf\sonar.properties”, but the instructions in the link seem to imply I’m supposed to create another sonar.properties somewhere?? Is this even the right place to put that override?

Thanks for any help.


(Alexandre Gigleux) #2

Hello,

I confirm you need to download the BuildWrapper form the server and once unzipped, you should declare it in your PATH. Then you need to transform your 3 steps like this:

  1. SonarScanner.MSBuild.exe begin /k:mySonarQubeProject /d:sonar.host.url=http://localhost:9000 /d:sonar.login=abc123 /d:sonar.cfamily.build-wrapper-output="bw_output"
  2. build-wrapper-win-x86-64.exe --out-dir bw_output MSBuild.exe /t:Rebuild
  3. SonarScanner.MSBuild.exe end /d:sonar.login=abc123

Reference: https://docs.sonarqube.org/pages/viewpage.action?pageId=8520225