Plugins execution sequence

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Plugins execution sequence

Igor Deruga
Dear list members,

I am trying to write a plugin that is performing some post-installation
actions. All that I have is a maven-install-plugin with InstallMojo.java
re-written to suit my needs. Due to completely rewritten execute()
procedure, I have to run my plugin this way: "m2 clean:clean install
myplgn:install". I'd like the original install target to be executed
automaticaly before myplgn:install target. Is there a way to do it?

One more thing: something was said in the list about plugin.xml
configuration file. Is there any documentation on this topic? I know
that m2 docs are raw but the hope remains ;)

Sincerely
Igor Deruga

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Plugins execution sequence

Brett Porter
On 5/23/05, Igor Deruga <[hidden email]> wrote:
> I am trying to write a plugin that is performing some post-installation
> actions. All that I have is a maven-install-plugin with InstallMojo.java
> re-written to suit my needs. Due to completely rewritten execute()
> procedure, I have to run my plugin this way: "m2 clean:clean install
> myplgn:install". I'd like the original install target to be executed
> automaticaly before myplgn:install target. Is there a way to do it?

If you add your plugin configuration to the POM, including a goal for
install, and add:
@phase install
to your mojo, it will call your goal when the install goal is called.
See the previous thread with Matthew for more explanation.

> One more thing: something was said in the list about plugin.xml
> configuration file. Is there any documentation on this topic? I know
> that m2 docs are raw but the hope remains ;)

http://maven.apache.org/maven2/developers/mojo-api-specification.html

It is unnecessary to know the format of the plugin descriptor as it is
generated automatically and used behind the scenes (but it can be
helpful to look into it to see if it matches what you thought you said
in your mojo). It is META-INF/maven/plugin.xml.

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Plugins execution sequence

Igor Deruga
Thanks, Brett!
Got it.

Brett Porter wrote:

>On 5/23/05, Igor Deruga <[hidden email]> wrote:
>  
>
>>I am trying to write a plugin that is performing some post-installation
>>actions. All that I have is a maven-install-plugin with InstallMojo.java
>>re-written to suit my needs. Due to completely rewritten execute()
>>procedure, I have to run my plugin this way: "m2 clean:clean install
>>myplgn:install". I'd like the original install target to be executed
>>automaticaly before myplgn:install target. Is there a way to do it?
>>    
>>
>
>If you add your plugin configuration to the POM, including a goal for
>install, and add:
>@phase install
>to your mojo, it will call your goal when the install goal is called.
>See the previous thread with Matthew for more explanation.
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]