Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sensible group Id for individual project?

What is a sensible choice of group Id for a maven project that does not fall under any company/organisation/website? I understand that the convention com.companyname.projectname is used in order to avoid namespace conflicts between projects, but how should I come up with a prefix for an individual project I am starting?

like image 373
Andy W Avatar asked Feb 01 '16 20:02

Andy W


People also ask

What is group ID in project?

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. For example, org.apache.maven , org.apache.commons.

What should group ID?

groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package name rules, what means that has to be at least as a domain name you control, and you can create as many subgroups as you want. Look at More information about package names.

What should be groupId in Maven project?

Maven uses a set of identifiers, also called coordinates, to uniquely identify a project and specify how the project artifact should be packaged: 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 meant by Group ID?

1) In a Unix system, a GID (group ID) is a name that associates a system user with other users sharing something in common (perhaps a work project or a department name). It's often used for accounting purposes.


1 Answers

Take a look at the official guide:

groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package name rules, what means that has to be at least as a domain name you control, and you can create as many subgroups as you want. Look at More information about package names.

eg. org.apache.maven, org.apache.commons

A good way to determine the granularity of the groupId is to use the project structure. That is, if the current project is a multiple module project, it should append a new identifier to the parent's groupId.

eg. org.apache.maven, org.apache.maven.plugins, org.apache.maven.reporting

So, just as you would do for a package name, you should ideally use domain name, that represents the project. If you don't have one, you can just imaging your project having one. So "domain you control" might be your personal domain, or this specific project's domain. I.e. com.andyw.nextbigthing or com.nextbigthing. If you're considering it as something, that can be interesting to be picked up by community, you can skip the personal name and use org instead. I.e. org.nextbigthing.

like image 50
Dzmitry Paulenka Avatar answered Sep 19 '22 08:09

Dzmitry Paulenka