Maven - Goal

1 - About

A goal is the execution part of a plugin. An individual plugin may have multiple goals. Each goal may have a separate configuration.

If you are familiar with Ant, a goal is similar to a task.

A goal can dependant upon parameters defined in the pom.xml For instance, maven will executes jar:jar if the packaging type of the project is a JAR, and war:war if the packaging type of the project is a WAR.

Since Maven 3.0.3, for two plug-ins bound to the same phase, the order of execution is the same as the order in which you define them in the pom file.

3 - Management

3.1 - Default

Inside the build node of the pom.xl

    <defaultGoal>clean verify apache-rat:check clirr:check javadoc:javadoc</defaultGoal>

3.2 - Execution

Format syntax

mvn prefix:goal
:: or as the goal default to the name of the prefix
mvn prefix

  • with the fully-qualified name:

mvn groupId:artifactId:version:goal
# mvn org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file


  • version is by default the latest
  • groupId optionally takes its default
Executing the phase where the goal is/was bind will also execute the goal

mvn phase

3.3 - Binding

A goal is bind to a project's build lifecycle in the pom.xml file.

See the phase element below.

<project xmlns="" 
						<phase>package</phase> <!-- bind to the packaging phase -->

4 - Documentation / Reference

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap