3

I'm trying to use Sonar to analyse my projects in Eclipse. I am currently using Maven in eclipse. I installed the Sonar Eclipse plugin as described in this link.

But when I try and associate my project with Sonar, I get an error saying: project with key not found on server.

Am I missing some steps? I started the Sonar Server before connecting to eclipse. But nothing works. I even tried following this article (Sonar plugin Eclipse) but to no avail.

Please help..The Sonar documentation is not descriptive at all making it very hard for beginners like me to understand.

Community
  • 1
  • 1
user1218900
  • 97
  • 1
  • 2
  • 7

1 Answers1

6

You can not associate your project in Eclipse if you haven't first analysed it with Sonar (by running "mvn sonar:sonar" on your project).

Once your project has been succesfully analysed and that you can browse it in the Web UI (http://localhost:9000 by default), then you can try to associate your project within Eclipse and this will work.

  • "You can not associate your project in Eclipse if you haven't first analysed it with Sonar (by running "mvn sonar:sonar" on your project)." I get a whole load of errors when I do a maven build using sonar:sonar as the goal. – user1218900 Feb 21 '12 at 03:20
  • [ERROR] No plugin found for prefix 'sonar' in the current project and in the plugin groups – user1218900 Feb 21 '12 at 03:31
  • Now I get the following error : [ERROR] Plugin org.codehaus.sonar:sonar-maven-plugin:2.13 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.sonar:sonar-maven-plugin:jar:2.13: Could not transfer artifact org.codehaus.sonar:sonar-maven-plugin:pom:2.13 ConnectException: UnresolvedAddressException -> [Help 1] – user1218900 Feb 21 '12 at 04:06
  • Purge your local repository and run the build again. – Fabrice - SonarSource Team Feb 21 '12 at 07:23