Maven key concepts

Several key concepts are important to understand in the Maven framework.

Important: Applicable to Liberty, WebSphere® Application Server traditional
Project Object Model (POM)
Each Maven project provides a pom.xml file that captures dependencies, project structure properties, build phase tasks and behavior. Most of the POM properties have defaults that result in a compact but powerful mechanism for describing project build behavior.
Build phases and the build lifecycle
A build lifecycle consists of several phases. When a phase command is given, Maven runs every phase in the sequence up to and including the defined phase. After the pom.xml file is defined, the Maven tools prioritize specific build phases and react to phases from validate, code generation, resource assembly, and compilation.
A build lifecycle consists of the following phases:
  • validate
  • compile
  • test
  • package
  • integration-test
  • verify
  • install
  • deploy
More information on the build lifecycle can be found at http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
Goal
A goal represents a specific task that is finer than a build phase and that contributes to the building and managing of a project.
Packaging
Setting the packaging assigns a set of default goals. Examples of valid packaging values include jar, war, ear, and pom.
Maven plug-in
A plug-in describes a set of goals that are tied to a specific packaging scheme or process.
Mojo
A specific task that is implemented inside a plug-in. For example, a Java™ class implementation for deploying to your preferred runtime environment.
Archetype
Archetypes are used as project templates for setting up new projects. These templates make it easy to enable standards within your organization by defining packaging goals, plug-in settings, and predefined dependencies to standard libraries.
Maven repositories
Repositories are used to store build artifacts and dependencies of varying types. For example, archetypes, plug-ins, and JAR files, among others. Local repositories are populated lazily as needed from remote repositories for build purposes.