You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by EJ Ciramella <ej...@upromise.com> on 2008/04/10 03:09:23 UTC

binding a plugin to a lifecycle goal

I've written a few maven plugins now, most of the type that should be
called explicitly.
 
I have a new one however, that I'd like to be part of the regular
lifecycle.
 
I have this in my mojo:
 
/**
 * <description>
 * @goal assemble
 * @phase process-resources
 */
 
but when I run "mvn process-resources" it doesn't execute my plugin.
 
What am I doing wrong?

RE: binding a plugin to a lifecycle goal

Posted by ni...@planet.nl.
Take a look at the Maven Build Lifecycle page [1]. This page lists for each type of packaging which plugins and goals are added automatically to the lifecycle. All other goals you have to add yourself explicitly. Or in a parent pom file if you need them for many projects.

Hth,

Nick S.

[1] http://cvs.peopleware.be/training/maven/maven2/buildLifecyclePhases.html


-----Original Message-----
From: EJ Ciramella [mailto:ejciramella@upromise.com]
Sent: Thu 4/10/2008 03:39
To: Maven Users List
Subject: RE: binding a plugin to a lifecycle goal
 
I _just_ realized that.

But I've looked at the resources plugin - you don't have to bind that.

Is this just the way hand-rolled plugins work? 

-----Original Message-----
From: Olivier Dehon [mailto:odndev@gmail.com] 
Sent: Wednesday, April 09, 2008 9:21 PM
To: Maven Users List
Subject: Re: binding a plugin to a lifecycle goal

You need to add an <execution> in your POM like:

<build>
  <plugins>
    <plugin>
      <artifactId>maven-whatever-plugin</artifactId>
      <executions>
        <goals>
          <goal>assemble</goal>
        </goals>
      </executions>
    </plugin>
  </plugins>
</build>

The fact that you specified the @phase in your mojo will attach the
execution automatically to the process-resources phase.

-Olivier

On Wed, 2008-04-09 at 21:09 -0400, EJ Ciramella wrote:
> I've written a few maven plugins now, most of the type that should be
> called explicitly.
>  
> I have a new one however, that I'd like to be part of the regular
> lifecycle.
>  
> I have this in my mojo:
>  
> /**
>  * <description>
>  * @goal assemble
>  * @phase process-resources
>  */
>  
> but when I run "mvn process-resources" it doesn't execute my plugin.
>  
> What am I doing wrong?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org



RE: binding a plugin to a lifecycle goal

Posted by EJ Ciramella <ej...@upromise.com>.
I _just_ realized that.

But I've looked at the resources plugin - you don't have to bind that.

Is this just the way hand-rolled plugins work? 

-----Original Message-----
From: Olivier Dehon [mailto:odndev@gmail.com] 
Sent: Wednesday, April 09, 2008 9:21 PM
To: Maven Users List
Subject: Re: binding a plugin to a lifecycle goal

You need to add an <execution> in your POM like:

<build>
  <plugins>
    <plugin>
      <artifactId>maven-whatever-plugin</artifactId>
      <executions>
        <goals>
          <goal>assemble</goal>
        </goals>
      </executions>
    </plugin>
  </plugins>
</build>

The fact that you specified the @phase in your mojo will attach the
execution automatically to the process-resources phase.

-Olivier

On Wed, 2008-04-09 at 21:09 -0400, EJ Ciramella wrote:
> I've written a few maven plugins now, most of the type that should be
> called explicitly.
>  
> I have a new one however, that I'd like to be part of the regular
> lifecycle.
>  
> I have this in my mojo:
>  
> /**
>  * <description>
>  * @goal assemble
>  * @phase process-resources
>  */
>  
> but when I run "mvn process-resources" it doesn't execute my plugin.
>  
> What am I doing wrong?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: binding a plugin to a lifecycle goal

Posted by Olivier Dehon <od...@gmail.com>.
You need to add an <execution> in your POM like:

<build>
  <plugins>
    <plugin>
      <artifactId>maven-whatever-plugin</artifactId>
      <executions>
        <goals>
          <goal>assemble</goal>
        </goals>
      </executions>
    </plugin>
  </plugins>
</build>

The fact that you specified the @phase in your mojo will attach the
execution automatically to the process-resources phase.

-Olivier

On Wed, 2008-04-09 at 21:09 -0400, EJ Ciramella wrote:
> I've written a few maven plugins now, most of the type that should be
> called explicitly.
>  
> I have a new one however, that I'd like to be part of the regular
> lifecycle.
>  
> I have this in my mojo:
>  
> /**
>  * <description>
>  * @goal assemble
>  * @phase process-resources
>  */
>  
> but when I run "mvn process-resources" it doesn't execute my plugin.
>  
> What am I doing wrong?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org