SonarQube MSBuild integration failed

775 views
Skip to first unread message

Gopinath Nath

unread,
Apr 16, 2018, 12:51:25 PM4/16/18
to SonarQube
We are trying to integrate SonarQube with Jenkins for .Net console application. When we tried building using the script on Dev box we are to capture the result successfully. We tried using the same script in the Jenkins it is failing with the following message
Generating SonarQube project properties file to H:\Jenkins\jobs\PCDE_Sonar\workspace\.sonarqube\out\sonar-project.properties
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
  1. The project has not been built - the project must be built in between the begin and end steps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 upwards are supported
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
Writing processing summary to H:\Jenkins\jobs\PCDE_Sonar\workspace\.sonarqube\out\ProjectInfo.log
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
09:27:54.425  Creating a summary markdown file...
09:27:54.426  Post-processing failed. Exit code: 1

Script
I:\sonar-scanner-msbuild\sonar-scanner-msbuild-4.1.1.1164-net46\SonarScanner.MSBuild.exe begin /k:"AAA" /n:"BBB" /v:%build.number% /d:sonar.verbose=true /d:sonar.log.level=TRACE

&'C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe' H:\Jenkins\jobs\....\ProductCatalogDataExporter.sln /t:rebuild /P:VisualStudioVersion=14.0 /P:Configuration=Release /P:DeployOnBuild=True /P:Platform="Any CPU"

I:\sonar-scanner-msbuild\sonar-scanner-msbuild-4.1.1.1164-net46\SonarScanner.MSBuild.exe end

Please provide any information that would help. Thanks

nicolas...@sonarsource.com

unread,
Apr 17, 2018, 3:55:25 AM4/17/18
to SonarQube
Hi,

Looks like you've clarified the key part already:

When we tried building using the script on Dev box we are to capture the result successfully.

That's a good thing clarified, and is a clear indicator that you should now look closer at how Jenkins is behaving and orchestrating its stuff. Check working directories, command lines executed etc. The solution will lie in the difference between Jenkins workflow, and your locally.

Best regards,
Nicolas 
Reply all
Reply to author
Forward
0 new messages