Misused Maven terms Defined


May 19, 2008 By Brian Fox

When responding to questions on IRC, the Maven Users list, or giving Maven Training, I frequently run into misused terms of the Maven lingo. Here’s an attempt to define them “for the record”:

Reactor

When we refer to the “reactor” or “reactor build”, we are usually referring to the aggregation capability of Maven. If you define a pom with <modules>, Maven will read all of these modules and build then in the correct order based on dependencies. The component that does this is also called the reactor, which is why the term is often applied to the action of aggregating the builds.

Siblings

Sibling poms are poms that are built inside the same reactor, and often share a common Parent pom.

Parent Pom

A parent pom is simply a pom from which other poms inherit via a <parent> section. Poms that inherit from a parent are sometimes referred to as “children” or “child poms.”

Corporate Pom

A Corporate Pom is a Parent Pom that sits at the top of an inheritance structure for a corporation. This is a recommended best practice for centralizing certain configuration such as Enforcer rule configuration, default Plugin versions, etc. This may also be called an “Organizational Pom.” The term “Super Pom” is often mis-applied to Corporate Poms.

Super Pom

The Super Pom is a special pom that is contained inside the maven-project jar. This is the implied parent of all poms that don’t inherit from some other Parent pom. It is analogous to Java’s Object class. The Super Pom provides the defaults that make Maven easy to use, such as the Central repository, default locations for sources, etc. The Super Pom is not user editable but through the normal inheritance behavior of Maven, all the values may be overridden. To avoid confusion, the term Super Pom should be reserved for only this specific embedded pom.

Artifact

An artifact is essentially any file that is installed in a local repository or deployed to a remote repository. It has a unique id in the Maven coordinate system of groupId:artifactId:version:classifier:type.

Dependency

A dependency is an Artifact that is specifically declared in a pom to be needed for one of the various class path scopes.

Attached Artifact

Attached artifacts are additional related artifacts that get installed and deployed along with the “main” artifact. These are most often, javadocs, sources, bundles etc, but can actually be any file. A plugin must do the actual attaching, but random files may be attached with the build-helper-maven-plugin.
Attached artifacts automatically share the same groupId, ArtifactId and version as the main artifact but they are distinguished with an additional Classifier field.

Classifier

The Classifier is the least known of the Maven coordinates. A primary artifact automatically has an empty classifier and is not changeable. All attached artifacts must differ from each other with unique classifiers. The Maven2 repository layout constructs file names in the following format: [groupId]-[artifactId]-[version]-[classifier].[type]. Common classifiers are: sources, javadocs, bin and bundle.

Our book shows all these elements and more in action.