You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Partha Maitra <pa...@sasken.com> on 2010/05/04 14:14:19 UTC

Can we customize maven lifecycle?

Hi,
Can anyone please tell me how do I customize a maven lifecycle?
e.g. Clean Lifecycle has got the following
        pre-clean
        clean
        and post-clean,
 how about I want to perform a deep-clean after this post-clean is completed? so that when I try the command "mvn clean" the deep-clean also takes place(deep-clean is just a name for a goal in my example)

Thanks & Regards,
Partha Maitra.

________________________________
SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email.

Re: Can we customize maven lifecycle?

Posted by Anders Hammar <an...@hammar.net>.
I apologize! I thought I checked to get it right, but apparently I was to
quick...

/A

On Tue, May 4, 2010 at 16:04, <su...@wipro.com> wrote:

> Thanks Anders.
>
> But since its my name. I should voice my concern, that it is actually
> 'Subir' :-)
>
> Subir
>
> -----Original Message-----
> From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On
> Behalf Of Anders Hammar
> Sent: Tuesday, May 04, 2010 6:39 PM
> To: Maven Users List
> Subject: Re: Can we customize maven lifecycle?
>
> Overriding the default lifecycle is extremely over-kill in this case...
>
> Stephen's answer combined with Sabir's example is the solution.
>
> /Anders
>
> On Tue, May 4, 2010 at 14:51, Martin Gainty <mg...@hotmail.com> wrote:
>
> >
> > you'll need to override the default lifecycle..start here
> >
> > http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-se
> > ct-override-default-lifecycle.html#ex-override-lifecycle
> >
> > Martin Gainty
> > ______________________________________________
> > Verzicht und Vertraulichkeitanmerkung/Note de déni et de
> > confidentialité
> >
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
> > unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig.
> > Diese Nachricht dient lediglich dem Austausch von Informationen und
> > entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten
> > Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt
> uebernehmen.
> > Ce message est confidentiel et peut être privilégié. Si vous n'êtes
> > pas le destinataire prévu, nous te demandons avec bonté que pour
> > satisfaire informez l'expéditeur. N'importe quelle diffusion non
> > autorisée ou la copie de ceci est interdite. Ce message sert à
> > l'information seulement et n'aura pas n'importe quel effet légalement
> > obligatoire. Étant donné que les email peuvent facilement être sujets
> > à la manipulation, nous ne pouvons accepter aucune responsabilité pour le
> contenu fourni.
> >
> >
> >
> >
> > > From: partha.maitra@sasken.com
> > > To: users@maven.apache.org
> > > Date: Tue, 4 May 2010 17:44:19 +0530
> > > Subject: Can we customize maven lifecycle?
> > >
> > > Hi,
> > > Can anyone please tell me how do I customize a maven lifecycle?
> > > e.g. Clean Lifecycle has got the following
> > >         pre-clean
> > >         clean
> > >         and post-clean,
> > >  how about I want to perform a deep-clean after this post-clean is
> > completed? so that when I try the command "mvn clean" the deep-clean
> > also takes place(deep-clean is just a name for a goal in my example)
> > >
> > > Thanks & Regards,
> > > Partha Maitra.
> > >
> > > ________________________________
> > > SASKEN BUSINESS DISCLAIMER: This message may contain confidential,
> > proprietary or legally privileged information. In case you are not the
> > original intended Recipient of the message, you must not, directly or
> > indirectly, use, disclose, distribute, print, or copy any part of this
> > message and you are requested to delete it and inform the sender. Any
> > views expressed in this message are those of the individual sender
> > unless otherwise stated. Nothing contained in this message shall be
> > construed as an offer or acceptance of any offer by Sasken
> > Communication Technologies Limited ("Sasken") unless sent with that
> > express intent and with due authority of Sasken. Sasken has taken
> > enough precautions to prevent the spread of viruses. However the
> > company accepts no liability for any damage caused by any virus
> transmitted by this email.
> >
> > _________________________________________________________________
> > The New Busy think 9 to 5 is a cute idea. Combine multiple calendars
> > with Hotmail.
> >
> > http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid
> > =PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
> >
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to
> this message are intended for the exclusive use of the addressee(s) and may
> contain proprietary, confidential or privileged information. If you are not
> the intended recipient, you should not disseminate, distribute or copy this
> e-mail. Please notify the sender immediately and destroy all copies of this
> message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
>
> www.wipro.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Can we customize maven lifecycle?

Posted by su...@wipro.com.
Thanks Anders.

But since its my name. I should voice my concern, that it is actually 'Subir' :-)

Subir 

-----Original Message-----
From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On Behalf Of Anders Hammar
Sent: Tuesday, May 04, 2010 6:39 PM
To: Maven Users List
Subject: Re: Can we customize maven lifecycle?

Overriding the default lifecycle is extremely over-kill in this case...

Stephen's answer combined with Sabir's example is the solution.

/Anders

On Tue, May 4, 2010 at 14:51, Martin Gainty <mg...@hotmail.com> wrote:

>
> you'll need to override the default lifecycle..start here
>
> http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-se
> ct-override-default-lifecycle.html#ex-override-lifecycle
>
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de 
> confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede 
> unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. 
> Diese Nachricht dient lediglich dem Austausch von Informationen und 
> entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten 
> Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes 
> pas le destinataire prévu, nous te demandons avec bonté que pour 
> satisfaire informez l'expéditeur. N'importe quelle diffusion non 
> autorisée ou la copie de ceci est interdite. Ce message sert à 
> l'information seulement et n'aura pas n'importe quel effet légalement 
> obligatoire. Étant donné que les email peuvent facilement être sujets 
> à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
> > From: partha.maitra@sasken.com
> > To: users@maven.apache.org
> > Date: Tue, 4 May 2010 17:44:19 +0530
> > Subject: Can we customize maven lifecycle?
> >
> > Hi,
> > Can anyone please tell me how do I customize a maven lifecycle?
> > e.g. Clean Lifecycle has got the following
> >         pre-clean
> >         clean
> >         and post-clean,
> >  how about I want to perform a deep-clean after this post-clean is
> completed? so that when I try the command "mvn clean" the deep-clean 
> also takes place(deep-clean is just a name for a goal in my example)
> >
> > Thanks & Regards,
> > Partha Maitra.
> >
> > ________________________________
> > SASKEN BUSINESS DISCLAIMER: This message may contain confidential,
> proprietary or legally privileged information. In case you are not the 
> original intended Recipient of the message, you must not, directly or 
> indirectly, use, disclose, distribute, print, or copy any part of this 
> message and you are requested to delete it and inform the sender. Any 
> views expressed in this message are those of the individual sender 
> unless otherwise stated. Nothing contained in this message shall be 
> construed as an offer or acceptance of any offer by Sasken 
> Communication Technologies Limited ("Sasken") unless sent with that 
> express intent and with due authority of Sasken. Sasken has taken 
> enough precautions to prevent the spread of viruses. However the 
> company accepts no liability for any damage caused by any virus transmitted by this email.
>
> _________________________________________________________________
> The New Busy think 9 to 5 is a cute idea. Combine multiple calendars 
> with Hotmail.
>
> http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid
> =PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
>

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com

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


Re: Can we customize maven lifecycle?

Posted by Anders Hammar <an...@hammar.net>.
Overriding the default lifecycle is extremely over-kill in this case...

Stephen's answer combined with Sabir's example is the solution.

/Anders

On Tue, May 4, 2010 at 14:51, Martin Gainty <mg...@hotmail.com> wrote:

>
> you'll need to override the default lifecycle..start here
>
> http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-override-default-lifecycle.html#ex-override-lifecycle
>
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > From: partha.maitra@sasken.com
> > To: users@maven.apache.org
> > Date: Tue, 4 May 2010 17:44:19 +0530
> > Subject: Can we customize maven lifecycle?
> >
> > Hi,
> > Can anyone please tell me how do I customize a maven lifecycle?
> > e.g. Clean Lifecycle has got the following
> >         pre-clean
> >         clean
> >         and post-clean,
> >  how about I want to perform a deep-clean after this post-clean is
> completed? so that when I try the command "mvn clean" the deep-clean also
> takes place(deep-clean is just a name for a goal in my example)
> >
> > Thanks & Regards,
> > Partha Maitra.
> >
> > ________________________________
> > SASKEN BUSINESS DISCLAIMER: This message may contain confidential,
> proprietary or legally privileged information. In case you are not the
> original intended Recipient of the message, you must not, directly or
> indirectly, use, disclose, distribute, print, or copy any part of this
> message and you are requested to delete it and inform the sender. Any views
> expressed in this message are those of the individual sender unless
> otherwise stated. Nothing contained in this message shall be construed as an
> offer or acceptance of any offer by Sasken Communication Technologies
> Limited ("Sasken") unless sent with that express intent and with due
> authority of Sasken. Sasken has taken enough precautions to prevent the
> spread of viruses. However the company accepts no liability for any damage
> caused by any virus transmitted by this email.
>
> _________________________________________________________________
> The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with
> Hotmail.
>
> http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
>

RE: Can we customize maven lifecycle?

Posted by Martin Gainty <mg...@hotmail.com>.
you'll need to override the default lifecycle..start here
http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-override-default-lifecycle.html#ex-override-lifecycle

Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: partha.maitra@sasken.com
> To: users@maven.apache.org
> Date: Tue, 4 May 2010 17:44:19 +0530
> Subject: Can we customize maven lifecycle?
> 
> Hi,
> Can anyone please tell me how do I customize a maven lifecycle?
> e.g. Clean Lifecycle has got the following
>         pre-clean
>         clean
>         and post-clean,
>  how about I want to perform a deep-clean after this post-clean is completed? so that when I try the command "mvn clean" the deep-clean also takes place(deep-clean is just a name for a goal in my example)
> 
> Thanks & Regards,
> Partha Maitra.
> 
> ________________________________
> SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email.
 		 	   		  
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

RE: Can we customize maven lifecycle?

Posted by su...@wipro.com.
You can attach the goal to the post-clean phase of clean lifecycle.

One way is you may add a executions element in POM for specific plugin.
For example:

          <plugin>
            <groupId>{UR-plugin}</groupId>
            <artifactId>{UR-plugin}</artifactId>
            <executions>
              <execution>
                <id>{UR-ID}</id>
		    <phase>post-clean</phase>
                <goals>
                  <goal>deep-clean</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

Subir
-----Original Message-----
From: Partha Maitra [mailto:partha.maitra@sasken.com] 
Sent: Tuesday, May 04, 2010 5:44 PM
To: 'Maven Users List'
Subject: Can we customize maven lifecycle?

Hi,
Can anyone please tell me how do I customize a maven lifecycle?
e.g. Clean Lifecycle has got the following
        pre-clean
        clean
        and post-clean,
 how about I want to perform a deep-clean after this post-clean is
completed? so that when I try the command "mvn clean" the deep-clean
also takes place(deep-clean is just a name for a goal in my example)

Thanks & Regards,
Partha Maitra.

________________________________
SASKEN BUSINESS DISCLAIMER: This message may contain confidential,
proprietary or legally privileged information. In case you are not the
original intended Recipient of the message, you must not, directly or
indirectly, use, disclose, distribute, print, or copy any part of this
message and you are requested to delete it and inform the sender. Any
views expressed in this message are those of the individual sender
unless otherwise stated. Nothing contained in this message shall be
construed as an offer or acceptance of any offer by Sasken Communication
Technologies Limited ("Sasken") unless sent with that express intent and
with due authority of Sasken. Sasken has taken enough precautions to
prevent the spread of viruses. However the company accepts no liability
for any damage caused by any virus transmitted by this email.

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com

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


Re: Can we customize maven lifecycle?

Posted by Stephen Connolly <st...@gmail.com>.
1. the whole point of these lifecycles is that they all have standard names
for each phase... so to answer your question shortly: No and there will not
be a way either

2. post-clean does not run after clean... it is just a phase.... to ensure
your tasks are executed you need to do

mvn post-clean

as that is the only way to get the phase to run

3. You might be better served with profiles, e.g.

mvn -Pdeep-clean clean

On 4 May 2010 13:14, Partha Maitra <pa...@sasken.com> wrote:

> Hi,
> Can anyone please tell me how do I customize a maven lifecycle?
> e.g. Clean Lifecycle has got the following
>        pre-clean
>        clean
>        and post-clean,
>  how about I want to perform a deep-clean after this post-clean is
> completed? so that when I try the command "mvn clean" the deep-clean also
> takes place(deep-clean is just a name for a goal in my example)
>
> Thanks & Regards,
> Partha Maitra.
>
> ________________________________
> SASKEN BUSINESS DISCLAIMER: This message may contain confidential,
> proprietary or legally privileged information. In case you are not the
> original intended Recipient of the message, you must not, directly or
> indirectly, use, disclose, distribute, print, or copy any part of this
> message and you are requested to delete it and inform the sender. Any views
> expressed in this message are those of the individual sender unless
> otherwise stated. Nothing contained in this message shall be construed as an
> offer or acceptance of any offer by Sasken Communication Technologies
> Limited ("Sasken") unless sent with that express intent and with due
> authority of Sasken. Sasken has taken enough precautions to prevent the
> spread of viruses. However the company accepts no liability for any damage
> caused by any virus transmitted by this email.
>