0
votes

My jenkins project does 2 checkouts, one from a framework and one from an application A that uses the framework.

I want to run a sonar scanner on application A.

I Have 6 building steps in jenkins

Execute Windows batch command : nuget.exe restore "%WORKSPACE%\Framework\branches\1.0.1.0\Framework.sln"

Execute Windows batch command : nuget.exe restore "%WORKSPACE%\AppUsingFramework\branches\v1.1.3\AppUsingFramework.sln"

Build a Visual Studio project or solution using MSBuild : build framework

SonarQube Scanner for MSBuild - Begin Analysis // HOW DO I SET THE FOLDER TO %WORKSPACE%\AppUsingFramework\branches\v1.1.3 ?

Build a Visual Studio project or solution using MSBuild : build the application
MSBuild Build File  : AppUsingFramework\branches\v1.1.3\AppUsingFramework.sln

SonarQube Scanner for MSBuild - End Analysis

I get this message :

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 or end steps have not all been launched from the same folder

Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.

So I suspect that I should specify working folder (%WORKSPACE%\AppUsingFramework\branches\v1.1.3) to sonar when I start it, how do I do that ?

I use :

Jenkins 2.60.2

SonarQube Scanner for MSBuild 3.0.1.635 (install automatically from github)

MSBuild 15

1
Did you start the analysis from the root of the solution (executed a change directory if needed)? - Jeroen Heier
I don't know, i'm looking for a way to specify the path - Yvain

1 Answers

0
votes

By removing the unnecessary build framework step (it's built in the app already) and by only specifiying AppUsingFramework.sln without path the sonar scan succeed.