I have been trying to integrate Sonar with our Jenkins continous Integration system. I have installed the Sonar-plugin for Jenkins and configured it(specified the DB, DB Username and password etc). I have also specified the sonar-maven-plugin version as 1.0-beta-2.
Along with this plugin configuration, I have added a build post-action to run Sonar on my maven projects. But everytime Jenkins tries to execute sonar:sonar goal it fails with the below error.
Please help me guys in resolving this problem.
Thanks
[INFO] Building prof
[INFO] task-segment: [org.codehaus.mojo:sonar-maven-plugin:1.0-beta-2:sonar] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [sonar:sonar {execution: default-cli}]
[INFO] Sonar host: http://inmqbs:9000
[INFO] Sonar version: 3.3.2
[INFO] Execute: org.codehaus.sonar:sonar-maven-plugin:3.3.2:sonar
Downloading: http://troop:8081/nexus/content/groups/platform//org/codehaus/sonar/sonar-maven- plugin/3.3.2/sonar-maven-plugin-3.3.2.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2' in repository troop-maven-releases (http://troop:8081/nexus/content/groups/platform/)
Downloading: http://troop:8081/nexus/content/groups/platform//org/codehaus/sonar/sonar-maven-plugin/3.3.2/sonar-maven-plugin-3.3.2.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2' in repository central (http://repo1.maven.org/maven2)
Downloading: http://troop:8081/nexus/content/groups/platform//org/codehaus/sonar/sonar-maven-plugin/3.3.2/sonar-maven-plugin-3.3.2.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2' in repository troop-maven-releases (http://troop:8081/nexus/content/groups/platform/)
Downloading: http://troop:8081/nexus/content/groups/platform//org/codehaus/sonar/sonar-maven-plugin/3.3.2/sonar-maven-plugin-3.3.2.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: Unable to build project for plugin 'org.codehaus.sonar:sonar-maven-plugin': POM 'org.codehaus.sonar:sonar-maven-plugin' not found in repository: Unable to download the artifact from any repository
org.codehaus.sonar:sonar-maven-plugin:pom:3.3.2
from the specified remote repositories:
internal-repository (http://troop:8081/nexus/content/groups/platform/)
for project org.codehaus.sonar:sonar-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:103)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:79)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:694)
... 17 more