Maven Concepts

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

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 (ideally, globally) for a project. Specified as <groupId> at the top of the POM file.

Conventionally uses a dot notation, but it does not have to. When it does use the dot notation, the groupId does NOT have to correspond to the package structure of the project it designates; it is, though, a good practice to follow. When stored within a repository, the dots are replaced by OS specific directory separators, which becomes a relative directory structure from the base repository.

Artifact ID

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 (they are often all be the same ID, such as the Codehaus Mojo project groupId: org.codehaus.mojo). 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. In the case of the above project, my-project lives in $M2_REPO/org/codehaus/mojo/my-project.

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