Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven default phase for goal?

Tags:

java

maven

From what I understand, in maven, plugin goals can be attached to a lifecycle phase. What is the default phase, if it isn't defined?

like image 784
12rad Avatar asked Apr 18 '12 01:04

12rad


1 Answers

In my experience it depends on the plugin goal. For example, the assembly:single goal in the maven-assembly-plugin doesn't list a default phase. The source:jar-no-fork goal binds to the package phase by default. Typically each goal lists the default phase in the Attributes section of the documentation.

Another way to tell is to look at the source code (example: source:jar-no-fork mojo). Look for @phase in the class header comment block.

Last but not least: the packaging you select (jar, war, ear, pom, etc.) binds goals to the lifecycle phases by default. The Maven book describes the lifecycles and bound goals. The maven-core artifact includes the configuration file: /src/main/resources/META-INF/plexus/artifact-handlers.xml.

like image 57
user944849 Avatar answered Sep 21 '22 11:09

user944849