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?
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.
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.
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.
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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With