4

I've followed these instructions: http://docs.sonarqube.org/display/PLUG/Triggering+SonarQube+on+Jenkins+Job#TriggeringSonarQubeonJenkinsJob-TriggeringaProjectAnalysiswithMaven

SonarQube: 5.1.1,
Jenkins SonarQube Plugin: 2.2.1

my maven goals for the base project are
clean compiler:compile

When I build my project I get this error from the sonar post build task:

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project onu-main: SCM provider was set to "git" but no SCM provider found for this key. No SCM provider installed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project onu-main: SCM provider was set to "git" but no SCM provider found for this key. No SCM provider installed
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: SCM provider was set to "git" but no SCM provider found for this key. No SCM provider installed
    at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
    at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
    at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
Tunaki
  • 132,869
  • 46
  • 340
  • 423
green reign
  • 182
  • 2
  • 3
  • 11
  • Could you post your pom.xml please – Iker Aguayo Aug 11 '15 at 14:35
  • Do you have the jenkins git plugin and git client plugin installed? – tdrury Aug 11 '15 at 14:57
  • @tdrury Yes, I have the git plugins installed. My build works fine. It's just the sonar post build task that fails. – green reign Aug 11 '15 at 15:19
  • @IkerAguayo It is a multi-module project with about 20 poms. I found that if I Disable the SCM Sensor in the SonarQube settings this error goes away however SonarAnalysis does not include any files when pointing at my parent pom. If I just build one project using -pl option then I get this error. [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project onu-config: Unable to determine structure of project. Probably you use Maven Advanced Reactor Options with a broken tree of modules. "onu-test-common" is orphan -> [Help 1 – green reign Aug 11 '15 at 15:24
  • so I guess you can't use -pl but it doesn't seem to work at all building from a parent module of a multi-module project. – green reign Aug 11 '15 at 15:27
  • My project has about 500 POMs, it's in git, and I've not seen this. I do incremental builds most of the time, but the job that runs sonar always does a full build. Does your root POM have the /scm/connection element defined correctly? – tdrury Aug 11 '15 at 16:13
  • 5
    This error sounds like the one I got on [this post](http://stackoverflow.com/questions/28740785/error-in-sonarqube-when-launching-svn-blame). Is the sonar-scm-git-plugin installed? – Tunaki Aug 11 '15 at 17:40
  • I agree with @Tunaki, is the sonar-scm-git-plugin installed on the SonarQube instance? – Seb - SonarSource Team Aug 12 '15 at 09:57

2 Answers2

10

Call Sonar with maven parameter: -Dsonar.scm.disabled=true

Remy
  • 502
  • 6
  • 19
9

You can install the Git-plugin on your SonarQube-Server or remove the developerConnection-tag from your POMs, both will fix the issue (tested with SQ 5.1.1)

Frank
  • 741
  • 1
  • 10
  • 24