Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference of artifactId and name in maven POM

I am new to maven and I'm confused about the difference between the artifactId and name.

What I know is that artifactId is the name of the artifact you are creating. I know that artifactId together with the groupId is use to uniquely identifies an artifact. So what is <name> purpose in POM. like the pom below I got from a site there is an artifactId and at the same time a <name>.

<groupId>org.sonatype.mavenbook.multi</groupId> <artifactId>simple-parent</artifactId> <packaging>pom</packaging> <version>1.0</version> <name>Multi Chapter Simple Parent Project</name> 
like image 703
javako Avatar asked Jul 26 '16 15:07

javako


People also ask

What does artifactId mean in Maven?

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.

What is artifactId in POM file?

The groupId is an XML element in the POM. XML file of a Maven project that specifies the id of the project group. In contrast, artifactId is an XML element in the POM. XML of a Maven project that specifies the id of the project (artifact).

What is difference between groupId and artifactId in Maven?

The groupId is a parameter indicating the group or individual that created a project, which is often a reversed company domain name. The artifactId is the base package name used in the project, and we use the standard archetype.

What should be the groupId and artifactId in Maven?

The main difference between groupId and artifactId in Maven is that the groupId specifies the id of the project group while the artifactId specifies the id of the project. Show activity on this post. groupId uniquely identifies your project across all projects. artifactId is the name of the jar without version.


1 Answers

You are correct that the artifactId helps identify the project.

The name is simply a human-readable "friendly" name. It is not required for a basic setup.

From the Maven documentation,

artifactId: The artifactId is generally the name that the project is known by. Although the groupId is important, people within the group will rarely mention the groupId in discussion ... It, along with the groupId, create a key that separates this project from every other project in the world (at least, it should :) ). Along with the groupId, the artifactId fully defines the artifact's living quarters within the repository.

like image 110
OneCricketeer Avatar answered Sep 20 '22 17:09

OneCricketeer