0
votes

I am trying to setup SonarQube with jenkins which builds when triggered by a push to the git repo I set.

I was able to install the scanner plugin and configure it all fine but the problem I am encountering is that, when I add Sonar scanner to my build step, in the analysis properties section, it requires me to set the sonar.sources property. However, I want the scanner to parse through the files in my git repo not the files on my machine.

How can I set the properties so that the scanner analyzes the project from the repo?

I am using : Jenkins 2.107.1, SonarQube 7.0, Sonar Scanner 3.1.0

I currently have the following in my analysis properties:

  • sonar.projectKey=projKey
  • sonar.projectName=projName
  • sonar.projectVersion=1.0
  • sonar.sources={path}
  • sonar.java.binaries={path}
  • sonar.projectBaseDir={path}
1

1 Answers

0
votes

I figured it out after a bit.

Instead of setting the path where the source files are in my machine, i needed to set the path to the Jenkins workspace on the server I am using.

so I needed to add:

sonar.sources = C:\Users\collins\.jenkins\workspace\myProjName

Since I have already configured my Git repo with Jenkins, this workspace will also update accordingly.