Set source location for git plug-in

1,172 views
Skip to first unread message

Braden McDaniel

unread,
Apr 4, 2018, 2:45:25 PM4/4/18
to SonarQube
I posted this to Stack Overflow a few weeks ago, but got no responses.

I'll ask the question a bit more directly here:

How does one tell the git integration plug-in where to look for sources?

I have set

  sonar.sources=my-subdir
  sonar.scm.provider=git

…where "my-subdir" is a subdirectory of the Jenkins WORKSPACE. I get the error message:

  ERROR: Not inside a Git work tree: /path/to/my/workspace

Is this simply not a supported configuration? Does using the git plug-in require that the repository be cloned directly to WORKSPACE?

Julien HENRY

unread,
Apr 5, 2018, 6:21:32 AM4/5/18
to SonarQube
Hi,

If you have cloned your repo in the subdir "my-subdir" then the correct configuration is more like:

sonar.projectBaseDir=$WORKSPACE/my-subdir
sonar.sources=.
sonar.scm.provider=git

++

Julien

Braden McDaniel

unread,
Apr 6, 2018, 8:11:33 PM4/6/18
to SonarQube
On Thursday, April 5, 2018 at 6:21:32 AM UTC-4, Julien HENRY wrote:
If you have cloned your repo in the subdir "my-subdir" then the correct configuration is more like:

sonar.projectBaseDir=$WORKSPACE/my-subdir
sonar.sources=.
sonar.scm.provider=git

Aha! Thank you!
 
Braden

inampud...@gmail.com

unread,
May 3, 2018, 6:07:44 AM5/3/18
to SonarQube
Hii,
Can we directly access git project without cloning to local repo???
If there is a way, Please mention.

Yogesh
Reply all
Reply to author
Forward
0 new messages