user993797
user993797

Reputation: 145

How do plugin goals tie into build phases in maven

How do plugins add to build phases.

I realize that maven has a list of goals that it executes by default but when we add a plugin node to the pom.xml,

For example, as per the maven documentation if we include the following plugin

<plugin>
   <groupId>org.codehaus.modello</groupId>
   <artifactId>modello-maven-plugin</artifactId>
   <version>1.4</version>
   <executions>
     <execution>
       <configuration>
         <models>
           <model>src/main/mdo/maven.mdo</model>
         </models>
         <version>4.0.0</version>
       </configuration>
       <goals>
         <goal>java</goal>
       </goals>
     </execution>
   </executions>
 </plugin>

Q1. What build phase does it tie into by default ?

Q2. Does it get executed in addition to the 'default' goal?, for example if i have a plugin that just echos 'hello' and it gets tied to the compile phase, do i get a echo of 'hello' in addition to the compilation?

Thanks Venu

Upvotes: 1

Views: 394

Answers (1)

khmarbaise
khmarbaise

Reputation: 97359

You can see that in the documentation of the plugin which says the java goal is bound to generate-sources.

What you are talking about default goal does not exist. It makes more sense in the meaning of a default binding between maven-plugin:goal and the life-cycle phase in relationship with the packaging type of a project. There you have a kind of default binding which is defined in the Maven super pom which defines the goals and their execution in the life-cyclce.

Upvotes: 1

Related Questions