Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty GroupID sonar eclipse

I'm using Maven And Sonar with eclipse. I already have my maven projects on LocalHost 9000. But when i go to eclipse configure>associate with sonar says that my groupId is empty. I think thats not supposed to happen. Anybody know how to fix this? Thanks

like image 554
Eduardo Avatar asked Apr 13 '11 19:04

Eduardo


People also ask

What is groupId and artifactId in eclipse?

3.1.groupId – a unique base name of the company or group that created the project. artifactId – a unique name of the project. version – a version of the project.

What is Eclipse groupId?

groupId uniquely identifies your project across all projects. A group ID should follow Java's package name rules. This means it starts with a reversed domain name you control.


3 Answers

I encountered the same issue, the tricks here are:

  1. The key of the sonar project must follow the naming convention, [groupid]:[artifactid]. They are separated by a ":". For example, if the key com.example:sample, then the groupid is com.example, artifactid is sample.
  2. The eclipse project name must be same as the artifactid (case-sensitive).

So, you need to 1) change the sonar project key to the naming convention above, 2) change the eclipse project name to the artifactid. Then eclipse will be able to automatically link your eclipse project to sonar project when your click the button "Find on server".

like image 143
Mingjiang Shi Avatar answered Oct 20 '22 22:10

Mingjiang Shi


Few things to check:-

  1. Check the groupId is actually there in your pom.xml.
  2. Check that the artifactId and the eclipse project name are the same.
  3. Check that you typed groupId and artifactId in the associate with sonar dialog window. Then click find on server.
  4. Also make sure that the sonar plugin is set up on your eclipse (by going to Windows->Preferences->Sonar).

HTH.

like image 30
CoolBeans Avatar answered Oct 20 '22 23:10

CoolBeans


It got fixed by following the instructions mentioned here

like image 1
leenasn Avatar answered Oct 20 '22 23:10

leenasn