tfs - SonarQube MSBuild integration failed - using MSBuild definition for building .Net Application -


this first blog or query. new tfs admin role , sonarqube tool.

we using tfs 2013 alm in our project, project based on .net application (new .net well).

as per client requirement, trying integrate "sonarqube 5.2" customized build process template instead of default template.

i installed "sonarqube 5.2" on "abc server" , "tfs server/build agent" on "xyz". installed sonarqube scanner msbuild 2.1 on xyz server , updated environment variables & sonarqube runner xml accordingly.

as per standard link not using default template:-http://docs.sonarqube.org/display/scan/from+team+foundation+server+2013 , using customized build template, hadn't have pre/post build argument options.

so edited in customized build process template, added hooks pre/post build scripts activities , updated properties similar mentioned link :- http://www.colinsalmcorner.com/post/build-script-hooks-for-tfs-2012-builds

note: per above link, didn’t update "challenge 2 – environment variables" part in process template not running powershell script wanted execute msbuild.sonarqube.runner.exe.

used following activity & properties within customized process template (refer above link):

*convertworkspaceitem activity, set following properties:

• displayname: “get pre-build script local path” • input: prebuildscriptpath • result: prebuildscriptlocalpath • workspace: workspace 

set following properties in invokeprocess activity:

• arguments: string.format(" ""& '{0}' {1}"" ", prebuildscriptlocalpath, prebuildscriptargs) • displayname: “run pre-build script” • filename: “powershell” • working directory: sourcesdirectory* 

note: same thing done post build script

sequentially, placed these pre , post script activities under "try, compile , test" activity of process template.

in ms build definition using customized process template, setting below values in build process parameters (location/path of runner.exe on xyz server) :

pre-build script path : c:\sonarqube\bin\msbuild.sonarqube.runner.exe

pre-build script arguments : begin /n: /v:< project version #> /k:

post-build script path : c:\sonarqube\bin\msbuild.sonarqube.runner.exe

post-build script arguments : end

but after these changes, build getting partially successful , sonarqube integration failed following error:

*the sonarqube msbuild integration failed: sonarqube unable collect required information projects.

possible causes:

  1. project has not been built - project must built in between begin , end steps

  2. unsupported version of msbuild has been used build project. msbuild 12.0 upwards supported

  3. begin, build or end steps have not been launched same folder*

note: on xyz server (tfs build server) have msbuild 12.0 , build happening under sourcesdirectory ".sonarqube" folder getting created within same directory.

also on xyz server's command prompt (within location of sourcedirectory or applicationname.sln available), ran following sonarqube commands, analysis successful , reports generated on sonarqube dashboard:

- msbuild.sonarqube.runner begin /n:<project name>  /v:< project version #>  /k: <project key> - "c:\program files (x86)\msbuild\12.0\bin\msbuild.exe" "applicationname.sln" /p:configuration=debug /p:platform="any cpu" - msbuild.sonarqube.runner end 

kindly go through this, great if can guide me , provide concrete explanation resolve this.

let me know if need other information.

as read in comment:

msbuild.sonarqube.runner installed on "c:\sonarquberunner\" , msbuild under "c:\windows\microsoft.net\framework\v4.0.30319\msbuild.exe" , build directory on tfs server "d:\data\build\$(buildagentid)\$(builddefinitionpath)" (location of source code build).

you have installed msbuild 12, build agent calling version 4.0

you need modify build process template in order achieve that.

find run msbuild activity in build template , set toolpath = “c:\program files (x86)\msbuild\12.0\bin\” or path of msbuild 12


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -