Sonarqube creating .sonarqube directory in wrong place with Jenkins


(Jordan Juel) #1

Having issues with the Sonar plugin for Jenkins. So we are working on changing the way we create our builds. We used to just use a Powershell build step to do all the checking out of our code from SVN. Now I am using the SVN plugin. All that works great. However, in our old jobs the .sonarqube folder that gets created would be in the base of the workspace. And that worked. With the new way it is getting created deep into the folder structure, and then producing the error:

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

If anyone has any ideas to help I would appreciate it. I have verified it is not issues #1 or #2 so I am assuming it is #3, but cannot figure out why it is doing what it is doing. Thanks!

(Jordan Juel) #2

I am not sure why, but it appears as if the Sonar steps are being started from deep within my folder structure after checking out from SVN. Then the build gets started from the base of the workspace directory. I noticed if I check out my base project to the base of the workspace and then move it into the folder structure I want with a Powershell build step that the .sonarqube folder gets created in the base of the workspace and everything works great. I would love to be able to by pass this step of copying with Powershell because it is fairly brittle and would need to be different for all of our jobs.

Is there a better way to make sure that begin, build and end all start in the same directory?