You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Thorsten Vogel <tv...@web.de> on 2007/02/09 17:19:26 UTC

[m2] plugin development question

Good day everyone,



i want to achieve the following in a m2 plugin but i don't know if it is
possible (i am new to m2 but i have used m1 intensively in the past):

1. One plugin/mojo must be executed when the build starts.
2. One plugin/mojo must be executed when the build ends and it needs to
detect if there were build errors.

How would i accomplish this?

Is there a way to register a build lifecycle listener somehow or can i
achieve this with mutiple plugins?



Thank you in advance!
Thorsten


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


Re: [m2] plugin development question

Posted by Wayne Fay <wa...@gmail.com>.
Of course, if you adjusted the mvn.bat file, your changes will not
work when M2.0.5 is released which is why I suggested you use the
mavenrc_*.bat files instead. Assuming your changes were pretty
minimal, it will be easy to apply those changes to future mvn.bat
files, so no big deal.

I'm glad to help. ;-)  The LED effects sound cool...

Wayne

On 2/9/07, Thorsten Vogel <tv...@web.de> wrote:
> Thank you Wayne, the information you shared helped me to accomplish what i
> wanted!
> I modified the mvn.bat file to call some scripts i created. That was pretty
> easy!
>
> Thanks,
> Thorsten
>
> PS. As a side-effect, I also found a way to indicate maven build
> success/failure with my Dell XPS Laptop integrated LEDs, which is totally
> awesome :-D
>
> -----Ursprüngliche Nachricht-----
> Von: users-return-64210-tvcom=web.de@maven.apache.org
> [mailto:users-return-64210-tvcom=web.de@maven.apache.org] Im Auftrag von
> Wayne Fay
> Gesendet: Freitag, 9. Februar 2007 19:15
> An: Maven Users List
> Betreff: Re: [m2] plugin development question
>
> I have no idea if this is possible with M2 plugins as I haven't done a whole
> lot in that area yet. The first one should be relatively easy -- make a mojo
> and assign it to the validate phase. But I'm not sure you can assign a mojo
> to the "last" phase when you don't know which one that will be especially
> when an error occurs. Someone else who knows more about plugins will
> hopefully reply with more info here.
>
> So instead, I might suggest using the %HOME%\mavenrc_pre.bat and
> %HOME%\mavenrc_post.bat files (assuming you're on Windows) specified in
> mvn.bat to do the start/stop process you're looking for. Or if you're not on
> Windows, the "mvn" batch script seems to look for and execute /etc/mavenrc
> and $HOME/.mavenrc before calling the Maven java process. But it does not
> have a corresponding "post" call.
>
> Alternatively, I would override the entire mvn batch file stuff with my own,
> perhaps call it mymvn, and do the start/stop stuff in mymvn, and then call
> the real mvn batch file from there. This seems easiest to me, especially if
> you're only developing on one common platform.
>
> Wayne
>
> On 2/9/07, Thorsten Vogel <tv...@web.de> wrote:
> > Good day everyone,
> >
> >
> >
> > i want to achieve the following in a m2 plugin but i don't know if it
> > is possible (i am new to m2 but i have used m1 intensively in the past):
> >
> > 1. One plugin/mojo must be executed when the build starts.
> > 2. One plugin/mojo must be executed when the build ends and it needs
> > to detect if there were build errors.
> >
> > How would i accomplish this?
> >
> > Is there a way to register a build lifecycle listener somehow or can i
> > achieve this with mutiple plugins?
> >
> >
> >
> > Thank you in advance!
> > Thorsten
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>
> ---------------------------------------------------------------------
> 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


AW: [m2] plugin development question

Posted by Thorsten Vogel <tv...@web.de>.
Thank you Wayne, the information you shared helped me to accomplish what i
wanted! 
I modified the mvn.bat file to call some scripts i created. That was pretty
easy!

Thanks,
Thorsten

PS. As a side-effect, I also found a way to indicate maven build
success/failure with my Dell XPS Laptop integrated LEDs, which is totally
awesome :-D

-----Ursprüngliche Nachricht-----
Von: users-return-64210-tvcom=web.de@maven.apache.org
[mailto:users-return-64210-tvcom=web.de@maven.apache.org] Im Auftrag von
Wayne Fay
Gesendet: Freitag, 9. Februar 2007 19:15
An: Maven Users List
Betreff: Re: [m2] plugin development question

I have no idea if this is possible with M2 plugins as I haven't done a whole
lot in that area yet. The first one should be relatively easy -- make a mojo
and assign it to the validate phase. But I'm not sure you can assign a mojo
to the "last" phase when you don't know which one that will be especially
when an error occurs. Someone else who knows more about plugins will
hopefully reply with more info here.

So instead, I might suggest using the %HOME%\mavenrc_pre.bat and
%HOME%\mavenrc_post.bat files (assuming you're on Windows) specified in
mvn.bat to do the start/stop process you're looking for. Or if you're not on
Windows, the "mvn" batch script seems to look for and execute /etc/mavenrc
and $HOME/.mavenrc before calling the Maven java process. But it does not
have a corresponding "post" call.

Alternatively, I would override the entire mvn batch file stuff with my own,
perhaps call it mymvn, and do the start/stop stuff in mymvn, and then call
the real mvn batch file from there. This seems easiest to me, especially if
you're only developing on one common platform.

Wayne

On 2/9/07, Thorsten Vogel <tv...@web.de> wrote:
> Good day everyone,
>
>
>
> i want to achieve the following in a m2 plugin but i don't know if it 
> is possible (i am new to m2 but i have used m1 intensively in the past):
>
> 1. One plugin/mojo must be executed when the build starts.
> 2. One plugin/mojo must be executed when the build ends and it needs 
> to detect if there were build errors.
>
> How would i accomplish this?
>
> Is there a way to register a build lifecycle listener somehow or can i 
> achieve this with mutiple plugins?
>
>
>
> Thank you in advance!
> Thorsten
>
>
> ---------------------------------------------------------------------
> 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


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


Re: [m2] plugin development question

Posted by Wayne Fay <wa...@gmail.com>.
I have no idea if this is possible with M2 plugins as I haven't done a
whole lot in that area yet. The first one should be relatively easy --
make a mojo and assign it to the validate phase. But I'm not sure you
can assign a mojo to the "last" phase when you don't know which one
that will be especially when an error occurs. Someone else who knows
more about plugins will hopefully reply with more info here.

So instead, I might suggest using the %HOME%\mavenrc_pre.bat and
%HOME%\mavenrc_post.bat files (assuming you're on Windows) specified
in mvn.bat to do the start/stop process you're looking for. Or if
you're not on Windows, the "mvn" batch script seems to look for and
execute /etc/mavenrc and $HOME/.mavenrc before calling the Maven java
process. But it does not have a corresponding "post" call.

Alternatively, I would override the entire mvn batch file stuff with
my own, perhaps call it mymvn, and do the start/stop stuff in mymvn,
and then call the real mvn batch file from there. This seems easiest
to me, especially if you're only developing on one common platform.

Wayne

On 2/9/07, Thorsten Vogel <tv...@web.de> wrote:
> Good day everyone,
>
>
>
> i want to achieve the following in a m2 plugin but i don't know if it is
> possible (i am new to m2 but i have used m1 intensively in the past):
>
> 1. One plugin/mojo must be executed when the build starts.
> 2. One plugin/mojo must be executed when the build ends and it needs to
> detect if there were build errors.
>
> How would i accomplish this?
>
> Is there a way to register a build lifecycle listener somehow or can i
> achieve this with mutiple plugins?
>
>
>
> Thank you in advance!
> Thorsten
>
>
> ---------------------------------------------------------------------
> 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