The "build-wrapper-dump.json" file was found empty

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) - sonar-scanner-msbuild- ; build-wrapper-win-x86-64.exe Version 6.7

  • what are you trying to achieve - Scan a complete project which has a mix of C++ and C# projects.

  • what have you tried so far to achieve this:
    SonarScanner.MSBuild.exe begin /k:“c.dn.em.PROJ-TEST” /n:“PROJ 4.1.0 Test” /v:“4.1.0” /“build_wrapper_output_directory” /d:sonar.sourceEncoding=UTF-8 /d:sonar.verbose=true /d:sonar.cfamily.cache.enabled=true /d:sonar.cfamily.cache.path=.cfamily-cache /d:sonar.cfamily.threads=4
    build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory “C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe” “%WORKSPACE%\BuildScripts\TargetFiles\BuildDeliverables\Scripts.Build.proj” /fl /t:BuildDeliverableSolutions /v:d
    SonarScanner.MSBuild.exe end

      The build command will call other build commands which will build all the sln which are associated with this project. This includes C++ projects as well as C# projects.


INFO: Loading cache from: E:\JenkinsWorkspace\Build_SRC\Src\Src\Core_Component.cfamily-cache\analysis_state
INFO: Subprocess(es) done in 0ms
INFO: Cache: 0/0 hits, 135 bytes
INFO: 0 compilation units analyzed
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:35.689s
INFO: Final Memory: 39M/247M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found empty. Please make sure that:

  • you are using the latest version of the build-wrapper and the SonarCFamily analyzer
  • your compiler is supported
  • you are wrapping your build correctly
  • you are wrapping a full/clean build
  • if you are building your project inside a Docker container, build-wrapper is wrapping the build process inside the container and not wrapping the external Docker process
    at com.sonar.cpp.plugin.CFamilySensor.execute(
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(

Hello @rehmana1,

Welcome to the community.
The problem is that the build-wrapper is empty.
When you are executing the command do you see from the log that it is building any C++ files?
Make sure that the command you are passing clean builds your project instead of building it incrementally. This might explain why the build-wrapper is empty.


Hello @Abbas_Sabra ,

Yes, I had checked that and it is building C++ files (About 128 of them) but somehow Sonar is unable to capture the same.
As a workaround, Called all the sln from a single CMD and it worked perfectly.

I am using the same build scripts “%WORKSPACE%\BuildScripts\TargetFiles\BuildDeliverables\Scripts.Build.proj” for other projects which are pure C# projects and Sonarqube is generating the reports required.

Following is the build framework structure:
=> Scripts.Build.proj is the parent script which is encased in between Begin and End of SonarScanner for MSBuild.
=> Scripts.Build.proj will call and build the solution(s). This is a mix of C++ and C# projects.

Expected to get a report but error mentioned above is encountered.

Here I am repeating myself:

If I do the same from bat file
=> Write a bat file and script it to build all the solution(s)
=> Call the bat files from build agent.
=> BAT file is is encased in between Begin and End of SonarScanner for MSBuild.

Result: Build completes successfully and reports are generated.

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