You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Durbha, Praveen (GE Healthcare)" <Pr...@ge.com> on 2008/11/25 18:07:34 UTC

Question on Maven Build Lifecycle

Hi,
 
I have ANT tasks configured in my POM file..I would like to have these
ANT tasks execute only if my Maven build is successful..
 
What build life cycle phase can I use to achieve this?

Thanks very much!

Re: Question on Maven Build Lifecycle

Posted by Nick Stolwijk <ni...@gmail.com>.
There is no such thing as a phase which have been a success. Each
plugin can call the build a failure. So if every plugin before that
phase didn't call the build a failure it is a success.

For example, you can set the maven-surefire-plugin (which runs your
tests) to fail the build on a failed test (this is default, you can
change this), you can also bind checkstyle, pmd and others to your
verify phase and these can also mark your build as a failure.

There is also the option to fail immediately or fail at end or even fail never:

mvn options:
-ff,--fail-fast               Stop at first failure in reactorized builds
-fae,--fail-at-end            Only fail the build afterwards; allow
all non-impacted builds to continue
-fn,--fail-never              NEVER fail the build, regardless of project result

Maybe you can create a plugin, which asks the current build status and
act on that information, but I'm not very well at home in the current
plugin API.

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Tue, Nov 25, 2008 at 9:56 PM, Durbha, Praveen (GE Healthcare)
<Pr...@ge.com> wrote:
> Well, they are ANT tasks to apply a label to Clearcase using the
> maven-ant-run-plugin.
>
> Right now, I have these tasks set up to execute during the "install"
> phase of the lifecycle..
>
> As this is one of the last few stages of the life cycle, it will execute
> only if the prior phases (compile, packaging, etc)have been a
> success..correct?
>
> Thanks
>
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Tuesday, November 25, 2008 11:36 AM
> To: Maven Users List
> Subject: Re: Question on Maven Build Lifecycle
>
>> I have ANT tasks configured in my POM file..I would like to have these
>
>> ANT tasks execute only if my Maven build is successful..
>
> What kind of tasks are they?
>
> What determines a "successful" Maven build -- compiles OK? tests OK?
> package creation is OK? installed to local repo cache OK? deployed to
> corporate repo OK? If you can answer that question, it will probably
> indicate where you should bind the tasks. This is not something we can
> answer for you.
>
> Wayne
>
> ---------------------------------------------------------------------
> 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: Question on Maven Build Lifecycle

Posted by "Durbha, Praveen (GE Healthcare)" <Pr...@ge.com>.
Well, they are ANT tasks to apply a label to Clearcase using the
maven-ant-run-plugin.

Right now, I have these tasks set up to execute during the "install"
phase of the lifecycle..

As this is one of the last few stages of the life cycle, it will execute
only if the prior phases (compile, packaging, etc)have been a
success..correct?

Thanks

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: Tuesday, November 25, 2008 11:36 AM
To: Maven Users List
Subject: Re: Question on Maven Build Lifecycle

> I have ANT tasks configured in my POM file..I would like to have these

> ANT tasks execute only if my Maven build is successful..

What kind of tasks are they?

What determines a "successful" Maven build -- compiles OK? tests OK?
package creation is OK? installed to local repo cache OK? deployed to
corporate repo OK? If you can answer that question, it will probably
indicate where you should bind the tasks. This is not something we can
answer for you.

Wayne

---------------------------------------------------------------------
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: Question on Maven Build Lifecycle

Posted by Wayne Fay <wa...@gmail.com>.
> I have ANT tasks configured in my POM file..I would like to have these
> ANT tasks execute only if my Maven build is successful..

What kind of tasks are they?

What determines a "successful" Maven build -- compiles OK? tests OK?
package creation is OK? installed to local repo cache OK? deployed to
corporate repo OK? If you can answer that question, it will probably
indicate where you should bind the tasks. This is not something we can
answer for you.

Wayne

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


Re: Question on Maven Build Lifecycle

Posted by Nick Stolwijk <ni...@gmail.com>.
If you want to bind it to the lifecycle, the last phase is deploy. [1]
If you want to do it after deploy, you should invoke maven like "mvn
deploy plugin:goal".

[1] http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



On Tue, Nov 25, 2008 at 6:07 PM, Durbha, Praveen (GE Healthcare)
<Pr...@ge.com> wrote:
> Hi,
>
> I have ANT tasks configured in my POM file..I would like to have these
> ANT tasks execute only if my Maven build is successful..
>
> What build life cycle phase can I use to achieve this?
>
> Thanks very much!
>

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