Maven Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 2: Line 2:


* [[Maven#Subjects|Maven]]
* [[Maven#Subjects|Maven]]
=Maven Coordinates=
<tt>groupId:artifactId:version</tt> is the minimum amount of information to fully and unequivocally identify an artifact, and constitute an address and a timestamp. This information is referred to as ''maven coordinates''. More details about each component below.
==Group ID==
An unique identifier for a project. Specified as [[Maven_pom.xml#.3CgroupId.3E|<groupId>]] at the top of the POM file.
groupId: This is generally unique amongst an organization or a project. For example, all core Maven artifacts do (well, should) live under the groupId org.apache.maven. Group ID's do not necessarily use the dot notation, for example, the junit project. Note that the dot-notated groupId does not have to correspond to the package structure that the project contains. It is, however, a good practice to follow. When stored within a repository, the group acts much like the Java packaging structure does in an operating system. The dots are replaced by OS specific directory separators (such as '/' in Unix) which becomes a relative directory structure from the base repository. In the example given, the org.codehaus.mojo group lives within the directory $M2_REPO/org/codehaus/mojo.
==Artifact ID==
==Version==
==Packaging==
==Classifier==


=POM=
=POM=

Revision as of 16:31, 4 November 2016

Internal

Maven Coordinates

groupId:artifactId:version is the minimum amount of information to fully and unequivocally identify an artifact, and constitute an address and a timestamp. This information is referred to as maven coordinates. More details about each component below.

Group ID

An unique identifier for a project. Specified as <groupId> at the top of the POM file.

groupId: This is generally unique amongst an organization or a project. For example, all core Maven artifacts do (well, should) live under the groupId org.apache.maven. Group ID's do not necessarily use the dot notation, for example, the junit project. Note that the dot-notated groupId does not have to correspond to the package structure that the project contains. It is, however, a good practice to follow. When stored within a repository, the group acts much like the Java packaging structure does in an operating system. The dots are replaced by OS specific directory separators (such as '/' in Unix) which becomes a relative directory structure from the base repository. In the example given, the org.codehaus.mojo group lives within the directory $M2_REPO/org/codehaus/mojo.


Artifact ID

Version

Packaging

Classifier

POM

pom.xml

Profile

Maven Profile

Lifecycle

Maven Lifecycle

System Properties

System properties can be declared and exposed to the build in the <properties> section of pom.xml. See:

pom.xml <properties>

Dependencies

Maven Dependencies

Repositories

Maven Repositories

Multi-Module Maven Projects

Multi-Module Maven Projects