tags:

views:

3493

answers:

7

I have followed the directions to integrate Sonar with Maven (http://docs.codehaus.org/display/SONAR/Install+Sonar) - altered settings.xml to include sonar repository at http: //localhost:9000/deploy/maven and I have verified I am able to see the readme.txt file at http: //localhost:9000/deploy/maven/README.txt, but when running sonar:sonar I keep getting the following message:

[INFO] [sonar:sonar] [INFO] Sonar host: http: //localhost:9000 [INFO] Sonar version: 1.7 Downloading: http: //localhost:9000/deploy/maven/org/codehaus/sonar/runtime/sonar -core-maven-plugin/20090803213910/sonar-core-maven-plugin-20090803213910.pom Downloading: http: //:8081/nexus/content/groups/public/org/codehaus/ sonar/runtime/sonar-core-maven-plugin/20090803213910/sonar-core-maven-plugin-200 90803213910.pom [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Can not execute Sonar

Embedded error: Unable to build project for plugin 'org.codehaus.sonar.runtime:s onar-core-maven-plugin': POM 'org.codehaus.sonar.runtime:sonar-core-maven-plugin ' not found in repository: Unable to download the artifact from any repository

org.codehaus.sonar.runtime:sonar-core-maven-plugin:pom:20090803213910

from the specified remote repositories: sonar (http: //localhost:9000/deploy/maven), nexus (http: //:8081/nexus/content/groups/public),

for project org.codehaus.sonar.runtime:sonar-core-maven-plugin [INFO] ------------------------------------------------------------------------

Any idea what I am missing?

A: 

localhost is not a remote host; localhost is an alias for the machine you're on. so it's trying to download the stuff from a maven repository server running on your machine.

lumpynose
Correct, the Sonar service I am trying to upload results to is running on the same machine I am running mvn sonar:sonar. I also have Nexus installed on this machine (as shown in the original post), but for debugging purposes to solve this problem I commented out the mirror configuration in Maven settings.xml - same results.
A: 

Ok, thanks for the clarification.

What about the url given in the error messages,

http: //:8081/nexus/content/groups/public

There's no host in that. The one above in your output is similarly odd looking.

It also looks like it's complaining about not being able to download the sonar plugin; are you sure you have your stuff set up so that maven can get to a repository that has that?

lumpynose
yeah, I had to modify that to include random spaces because I am a new user and tried to include more than one web link in my post. All that was showing was that maven was looking for the sonar POM in the local Nexus repository as part of my Maven mirror settings.
+1  A: 

Not sure what the issue was, but by upgrading to version 1.9.2 (I was trying to get 1.7 working as it is currently running on another server) and removing the sonar-maven-plugin definition in the project POM, running mvn sonar:sonar was able to execute successfully.

+2  A: 

Hi 1.The maven plugins required to run sonar on your localhost reside @ http://localhost:9000/deploy/maven/........... ( they are bundled with your sonar installation )

2.to pick the plugins(bundled with your sonar installation) you need to execute 'mvn sonar:sonar ' at the root of your application

3.You need not depend on the nexus repositories of your company

4.When you do not want to depend on the nexus repositories, you need to mirror out 'sonar' in the mirror declaration of your settings.xml => *,!sonar include this !sonar in your mirror definitions

  1. declare http://localhost:9000 in one of your active profiles

  2. Start your sonar server

Now execute the command 'mvn sonar:sonar' ,the maven-sonar plugins are picked from local sonar installation..

Good Luck , aravind.dev

aravind
A: 

Thx, I've got the same problem, the last answer is a correct solution and working.

robrecht
+1  A: 

I use nexus as well, and the setting => *,!sonar solve this problem as well, thx, aravind

larrycai
A: 
Sreekar