What is the difference between artifactId and groupId in pom.xml?

sofs1 picture sofs1 · Aug 27, 2016 · Viewed 34.4k times · Source

How would you explain it to a newbie web developer or programmer with some real world organization example (like say facebook company or Google company)?

Answer

Jameson picture Jameson · Aug 27, 2016

From maven.apache.org, Naming Conventions:

artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar you have to take the name of the jar as it's distributed. eg. maven, commons-math

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