How can I change the working directory of MSBuild.SonarQube.Runner.exe?

寵の児 提交于 2019-12-12 03:23:42

问题


We are currently calling the runner like this:

D:\BuildTools\MSBSonarQubeRunner-1.0.2\MSBuild.SonarQube.Runner.exe begin /k:"someKey" /n:"someName" /v:"someVersion" /d:sonar.resharper.cs.reportPath="K:\somePath\resharper.xml"

We want to have the output of sonar in K:\.sonarqube

We tried to use the command line arg /d:sonar.working.directory=K:\\.sonarqube but that didn't work. We also tried setting the working directory in the SonarQube.Analysis.xml like this: <Property Name="sonar.working.directory">K:\.sonarqube\</Property>

That didn't work too ... We need to have it in a top directory, because the sonar runner throws an PathTooLongException (out path is 286 characters long).

Thank you for your help


回答1:


It is not possible to change the working directory of the SonarQube Scanner for MSBuild.

You can however launch the build from another folder, but all 3 steps (begin, msbuild and end) must be launched from that folder:

  1. k:
  2. D:\BuildTools\MSBSonarQubeRunner-1.0.2\MSBuild.SonarQube.Runner.exe begin ....
  3. msbuild /t:rebuild c:\whereever\your\sources\are\Solution.sln
  4. D:\BuildTools\MSBSonarQubeRunner-1.0.2\MSBuild.SonarQube.Runner.exe end


来源:https://stackoverflow.com/questions/34182934/how-can-i-change-the-working-directory-of-msbuild-sonarqube-runner-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!