Re: How to run a maven goal when there is tests failures?

2012-01-11 Thread Stephen Connolly
you may have to override the default phases, disable surefire (as you
cannot unbind from lifecycle), and change the includes pattern for failsafe
to the surefire one.

if you do the above, should have no side effects other than your intended
as they both use the same back end

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 11 Jan 2012 07:32, Xavier S. xavier.seign...@gmail.com wrote:

 :)
 Sorry, I missed your answer in the noise! I'll give it a try and let you
 know. (I hope it won't have side effects using failsafe rather than
 surefire).

 Regards,

 Xavier

 2012/1/10 Stephen Connolly stephen.alan.conno...@gmail.com

  given that nobody else bothered to read the original question, it does
 not
  surprise me that nobody bothered to read my original answer of using
  failsafe ;-)
 
  - Stephen
 
  ---
  Sent from my Android phone, so random spelling mistakes, random nonsense
  words and other nonsense are a direct result of using swype to type on
 the
  screen
  On 10 Jan 2012 18:16, Stephen Connolly 
 stephen.alan.conno...@gmail.com
  wrote:
 
   use failsafe.
  
   parse the failsafe results yourself... if they show a test failure, do
   your special thing then let failsafe verify stop the build
  
   - Stephen
  
   ---
   Sent from my Android phone, so random spelling mistakes, random
 nonsense
   words and other nonsense are a direct result of using swype to type on
  the
   screen
   On 10 Jan 2012 16:58, Xavier S. xavier.seign...@gmail.com wrote:
  
   Thanks Guillaume!
   That's exactly what I want to do.
  
   So people, any idea?
  
   Regards,
  
   Xavier
  
   2012/1/10 Guillaume Polet guillaume.po...@gmail.com
  
Tell me if I am wrong Xavier, but I think that what he would like to
  do
   is
perform something special when the tests fail, not just skip them or
  not
fail the build. My guess would be that he is expecting some kind of
  on
failure/on tests failure phase where he could attach other maven
   plugins
to perform alternate behaviour.
   
Unfortunately I have no idea on how this could be done. Probably
 using
   Ant
or by writing your own plugin, but I find both solutions quite poor.
   Maybe
Maven is not the tool to be used to perform this. Although you can
 do
  a
   lot
of things with Maven, sometimes bending its original objectives too
  far
away is just cumbersome and counter-productive /(not sure this
  english,
btw).
   
/Cheers,
Guillaume
Le 10/01/2012 17:22, Jeff MAURY a écrit :
   
 what about
   
  
 
 http://maven.apache.org/**plugins/maven-surefire-plugin/**test-mojo.html#
**testFailureIgnore
  
 
 http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#testFailureIgnore
   
   
Jeff MAURY
   
On Tue, Jan 10, 2012 at 4:55 PM, Xavier S.
 xavier.seign...@gmail.com
   **
wrote:
   
 Thanks for all your answers, but I think I should re explain my
  need.
   
I don't want to skip the tests. The default fail fast mode of
 maven
   suits
me (section 6.1.8
   
http://www.sonatype.com/books/**mvnref-book/reference/running-**
sect-options.html
  
 
 http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html
   
).
   
I just want to run my custom mojo just after my tests failures and
   just
before the end of the maven execution (if there is build failures,
   maven
do
not even finishes the current test phase).
   
Regards,
   
Xavier
   
   
   
   
   
  
  
 



Re: How to run a maven goal when there is tests failures?

2012-01-11 Thread Guillaume Polet
Although I did see your answer, I did not understand how failsafe was 
resolving the problem, I do now.


Cheers,
Guillaume

Le 10/01/2012 19:19, Stephen Connolly a écrit :

given that nobody else bothered to read the original question, it does not
surprise me that nobody bothered to read my original answer of using
failsafe ;-)

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 10 Jan 2012 18:16, Stephen Connollystephen.alan.conno...@gmail.com
wrote:


use failsafe.

parse the failsafe results yourself... if they show a test failure, do
your special thing then let failsafe verify stop the build

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 10 Jan 2012 16:58, Xavier S.xavier.seign...@gmail.com  wrote:


Thanks Guillaume!
That's exactly what I want to do.

So people, any idea?

Regards,

Xavier

2012/1/10 Guillaume Poletguillaume.po...@gmail.com


Tell me if I am wrong Xavier, but I think that what he would like to do

is

perform something special when the tests fail, not just skip them or not
fail the build. My guess would be that he is expecting some kind of on
failure/on tests failure phase where he could attach other maven

plugins

to perform alternate behaviour.

Unfortunately I have no idea on how this could be done. Probably using

Ant

or by writing your own plugin, but I find both solutions quite poor.

Maybe

Maven is not the tool to be used to perform this. Although you can do a

lot

of things with Maven, sometimes bending its original objectives too far
away is just cumbersome and counter-productive /(not sure this english,
btw).

/Cheers,
Guillaume
Le 10/01/2012 17:22, Jeff MAURY a écrit :

  what about

http://maven.apache.org/**plugins/maven-surefire-plugin/**test-mojo.html#

**testFailureIgnore

http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#testFailureIgnore

Jeff MAURY

On Tue, Jan 10, 2012 at 4:55 PM, Xavier S.xavier.seign...@gmail.com

**

wrote:

  Thanks for all your answers, but I think I should re explain my need.

I don't want to skip the tests. The default fail fast mode of maven

suits

me (section 6.1.8

http://www.sonatype.com/books/**mvnref-book/reference/running-**
sect-options.html

http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html

).

I just want to run my custom mojo just after my tests failures and

just

before the end of the maven execution (if there is build failures,

maven

do
not even finishes the current test phase).

Regards,

Xavier







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



How to run a maven goal when there is tests failures?

2012-01-10 Thread Xavier S.
Hello,

I would like to know if there is a way to execute a goal when there is test
failures?

Since maven stops its execution (fail fast mode) after encountering a test
failure, is there any options to launch a goal between that test failure
and he stop of maven?

Regards,
Xavier.


Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Martin Höller
On Tuesday 10 January 2012 Xavier S. wrote:
 Hello,

 I would like to know if there is a way to execute a goal when there is
 test failures?

Use mvn -DskipTests.

You can also try mvn -Dmaven.test.skip=true, which is a bit longer and not 
only skips test execution but also skips test compilation.

hth,
- martin


signature.asc
Description: This is a digitally signed message part.


Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Stephen Connolly
you'd need to do something like failsafe, where the execution is
separated from the checking and failing the build might even get
what you want using just failsafe

On 10 January 2012 13:05, Xavier S. xavier.seign...@gmail.com wrote:
 Hello,

 I would like to know if there is a way to execute a goal when there is test
 failures?

 Since maven stops its execution (fail fast mode) after encountering a test
 failure, is there any options to launch a goal between that test failure
 and he stop of maven?

 Regards,
 Xavier.

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



Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Jeff MAURY
You can configure the maven surefire plugin to ignore errors (not the
default). Look at the Maven Surefire plugin documentation.

Regards
Jeff MAURY

-- Forwarded message --
From: Xavier S. xavier.seign...@gmail.com
Date: Tue, Jan 10, 2012 at 2:05 PM
Subject: How to run a maven goal when there is tests failures?
To: Maven Users List users@maven.apache.org


Hello,

I would like to know if there is a way to execute a goal when there is test
failures?

Since maven stops its execution (fail fast mode) after encountering a test
failure, is there any options to launch a goal between that test failure
and he stop of maven?

Regards,
Xavier.



-- 
Legacy code often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury


Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Benjamin Dreux
You can just skip the test.
To do so you have multiple solution.
Comment out all you test which could be long and error prone.
Remove them from you testSuite, which dependly hardly on your plateform.

And pass a special command to maven
http://maven.apache.org/general.html#skip-test
Or you can make some special profile for that.

Le 10 janvier 2012 08:05, Xavier S. xavier.seign...@gmail.com a écrit :
 Hello,

 I would like to know if there is a way to execute a goal when there is test
 failures?

 Since maven stops its execution (fail fast mode) after encountering a test
 failure, is there any options to launch a goal between that test failure
 and he stop of maven?

 Regards,
 Xavier.



-- 
Benjamin Dreux
Analyste-Programmeur
Chaire de logiciel libre-Finance Social et solidaire
UQAM
Montréal

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



Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Xavier S.
Thanks for all your answers, but I think I should re explain my need.

I don't want to skip the tests. The default fail fast mode of maven suits
me (section 6.1.8
http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html
).

I just want to run my custom mojo just after my tests failures and just
before the end of the maven execution (if there is build failures, maven do
not even finishes the current test phase).

Regards,

Xavier


Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Jeff MAURY
what about
http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#testFailureIgnore

Jeff MAURY

On Tue, Jan 10, 2012 at 4:55 PM, Xavier S. xavier.seign...@gmail.comwrote:

 Thanks for all your answers, but I think I should re explain my need.

 I don't want to skip the tests. The default fail fast mode of maven suits
 me (section 6.1.8

 http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html
 ).

 I just want to run my custom mojo just after my tests failures and just
 before the end of the maven execution (if there is build failures, maven do
 not even finishes the current test phase).

 Regards,

 Xavier




-- 
Legacy code often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury


Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Guillaume Polet
Tell me if I am wrong Xavier, but I think that what he would like to do 
is perform something special when the tests fail, not just skip them or 
not fail the build. My guess would be that he is expecting some kind of 
on failure/on tests failure phase where he could attach other maven 
plugins to perform alternate behaviour.


Unfortunately I have no idea on how this could be done. Probably using 
Ant or by writing your own plugin, but I find both solutions quite poor. 
Maybe Maven is not the tool to be used to perform this. Although you can 
do a lot of things with Maven, sometimes bending its original objectives 
too far away is just cumbersome and counter-productive /(not sure this 
english, btw).


/Cheers,
Guillaume
Le 10/01/2012 17:22, Jeff MAURY a écrit :

what about
http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#testFailureIgnore

Jeff MAURY

On Tue, Jan 10, 2012 at 4:55 PM, Xavier S.xavier.seign...@gmail.comwrote:


Thanks for all your answers, but I think I should re explain my need.

I don't want to skip the tests. The default fail fast mode of maven suits
me (section 6.1.8

http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html
).

I just want to run my custom mojo just after my tests failures and just
before the end of the maven execution (if there is build failures, maven do
not even finishes the current test phase).

Regards,

Xavier








Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Xavier S.
Thanks Guillaume!
That's exactly what I want to do.

So people, any idea?

Regards,

Xavier

2012/1/10 Guillaume Polet guillaume.po...@gmail.com

 Tell me if I am wrong Xavier, but I think that what he would like to do is
 perform something special when the tests fail, not just skip them or not
 fail the build. My guess would be that he is expecting some kind of on
 failure/on tests failure phase where he could attach other maven plugins
 to perform alternate behaviour.

 Unfortunately I have no idea on how this could be done. Probably using Ant
 or by writing your own plugin, but I find both solutions quite poor. Maybe
 Maven is not the tool to be used to perform this. Although you can do a lot
 of things with Maven, sometimes bending its original objectives too far
 away is just cumbersome and counter-productive /(not sure this english,
 btw).

 /Cheers,
 Guillaume
 Le 10/01/2012 17:22, Jeff MAURY a écrit :

  what about
 http://maven.apache.org/**plugins/maven-surefire-plugin/**test-mojo.html#
 **testFailureIgnorehttp://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#testFailureIgnore

 Jeff MAURY

 On Tue, Jan 10, 2012 at 4:55 PM, Xavier S.xavier.seign...@gmail.com**
 wrote:

  Thanks for all your answers, but I think I should re explain my need.

 I don't want to skip the tests. The default fail fast mode of maven suits
 me (section 6.1.8

 http://www.sonatype.com/books/**mvnref-book/reference/running-**
 sect-options.htmlhttp://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html
 ).

 I just want to run my custom mojo just after my tests failures and just
 before the end of the maven execution (if there is build failures, maven
 do
 not even finishes the current test phase).

 Regards,

 Xavier







Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Stephen Connolly
use failsafe.

parse the failsafe results yourself... if they show a test failure, do your
special thing then let failsafe verify stop the build

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 10 Jan 2012 16:58, Xavier S. xavier.seign...@gmail.com wrote:

 Thanks Guillaume!
 That's exactly what I want to do.

 So people, any idea?

 Regards,

 Xavier

 2012/1/10 Guillaume Polet guillaume.po...@gmail.com

  Tell me if I am wrong Xavier, but I think that what he would like to do
 is
  perform something special when the tests fail, not just skip them or not
  fail the build. My guess would be that he is expecting some kind of on
  failure/on tests failure phase where he could attach other maven
 plugins
  to perform alternate behaviour.
 
  Unfortunately I have no idea on how this could be done. Probably using
 Ant
  or by writing your own plugin, but I find both solutions quite poor.
 Maybe
  Maven is not the tool to be used to perform this. Although you can do a
 lot
  of things with Maven, sometimes bending its original objectives too far
  away is just cumbersome and counter-productive /(not sure this english,
  btw).
 
  /Cheers,
  Guillaume
  Le 10/01/2012 17:22, Jeff MAURY a écrit :
 
   what about
 
 http://maven.apache.org/**plugins/maven-surefire-plugin/**test-mojo.html#
  **testFailureIgnore
 http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#testFailureIgnore
 
 
  Jeff MAURY
 
  On Tue, Jan 10, 2012 at 4:55 PM, Xavier S.xavier.seign...@gmail.com**
  wrote:
 
   Thanks for all your answers, but I think I should re explain my need.
 
  I don't want to skip the tests. The default fail fast mode of maven
 suits
  me (section 6.1.8
 
  http://www.sonatype.com/books/**mvnref-book/reference/running-**
  sect-options.html
 http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html
 
  ).
 
  I just want to run my custom mojo just after my tests failures and just
  before the end of the maven execution (if there is build failures,
 maven
  do
  not even finishes the current test phase).
 
  Regards,
 
  Xavier
 
 
 
 
 



Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Stephen Connolly
given that nobody else bothered to read the original question, it does not
surprise me that nobody bothered to read my original answer of using
failsafe ;-)

- Stephen

---
Sent from my Android phone, so random spelling mistakes, random nonsense
words and other nonsense are a direct result of using swype to type on the
screen
On 10 Jan 2012 18:16, Stephen Connolly stephen.alan.conno...@gmail.com
wrote:

 use failsafe.

 parse the failsafe results yourself... if they show a test failure, do
 your special thing then let failsafe verify stop the build

 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 10 Jan 2012 16:58, Xavier S. xavier.seign...@gmail.com wrote:

 Thanks Guillaume!
 That's exactly what I want to do.

 So people, any idea?

 Regards,

 Xavier

 2012/1/10 Guillaume Polet guillaume.po...@gmail.com

  Tell me if I am wrong Xavier, but I think that what he would like to do
 is
  perform something special when the tests fail, not just skip them or not
  fail the build. My guess would be that he is expecting some kind of on
  failure/on tests failure phase where he could attach other maven
 plugins
  to perform alternate behaviour.
 
  Unfortunately I have no idea on how this could be done. Probably using
 Ant
  or by writing your own plugin, but I find both solutions quite poor.
 Maybe
  Maven is not the tool to be used to perform this. Although you can do a
 lot
  of things with Maven, sometimes bending its original objectives too far
  away is just cumbersome and counter-productive /(not sure this english,
  btw).
 
  /Cheers,
  Guillaume
  Le 10/01/2012 17:22, Jeff MAURY a écrit :
 
   what about
 
 http://maven.apache.org/**plugins/maven-surefire-plugin/**test-mojo.html#
  **testFailureIgnore
 http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#testFailureIgnore
 
 
  Jeff MAURY
 
  On Tue, Jan 10, 2012 at 4:55 PM, Xavier S.xavier.seign...@gmail.com
 **
  wrote:
 
   Thanks for all your answers, but I think I should re explain my need.
 
  I don't want to skip the tests. The default fail fast mode of maven
 suits
  me (section 6.1.8
 
  http://www.sonatype.com/books/**mvnref-book/reference/running-**
  sect-options.html
 http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html
 
  ).
 
  I just want to run my custom mojo just after my tests failures and
 just
  before the end of the maven execution (if there is build failures,
 maven
  do
  not even finishes the current test phase).
 
  Regards,
 
  Xavier
 
 
 
 
 




How to run a maven goal when there is tests failures?

2012-01-10 Thread Xavier S.
Hello,

I would like to know if there is a way to execute a goal when there is test
failures?

Since maven stops its execution (fail fast mode) after encountering a test
failure, is there any options to launch a goal between that test failure
and he stop of maven?

Regards,
Xavier.


RE: How to run a maven goal when there is tests failures?

2012-01-10 Thread Yuvaraj Vanarase
-  One has to write custom goal and attach to the test phase of maven 
build life cycle. Goal checks if test failure and do the action.

http://maven.apache.org/guides/plugin/guide-java-plugin-development.html





Regards,

Yuvaraj





-Original Message-
From: Xavier S. [mailto:xavier.seign...@gmail.com]
Sent: Tuesday, January 10, 2012 5:45 PM
To: Maven Users List
Subject: How to run a maven goal when there is tests failures?



Hello,



I would like to know if there is a way to execute a goal when there is test

failures?



Since maven stops its execution (fail fast mode) after encountering a test

failure, is there any options to launch a goal between that test failure

and he stop of maven?



Regards,

Xavier.


Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Xavier S.
:)
Sorry, I missed your answer in the noise! I'll give it a try and let you
know. (I hope it won't have side effects using failsafe rather than
surefire).

Regards,

Xavier

2012/1/10 Stephen Connolly stephen.alan.conno...@gmail.com

 given that nobody else bothered to read the original question, it does not
 surprise me that nobody bothered to read my original answer of using
 failsafe ;-)

 - Stephen

 ---
 Sent from my Android phone, so random spelling mistakes, random nonsense
 words and other nonsense are a direct result of using swype to type on the
 screen
 On 10 Jan 2012 18:16, Stephen Connolly stephen.alan.conno...@gmail.com
 wrote:

  use failsafe.
 
  parse the failsafe results yourself... if they show a test failure, do
  your special thing then let failsafe verify stop the build
 
  - Stephen
 
  ---
  Sent from my Android phone, so random spelling mistakes, random nonsense
  words and other nonsense are a direct result of using swype to type on
 the
  screen
  On 10 Jan 2012 16:58, Xavier S. xavier.seign...@gmail.com wrote:
 
  Thanks Guillaume!
  That's exactly what I want to do.
 
  So people, any idea?
 
  Regards,
 
  Xavier
 
  2012/1/10 Guillaume Polet guillaume.po...@gmail.com
 
   Tell me if I am wrong Xavier, but I think that what he would like to
 do
  is
   perform something special when the tests fail, not just skip them or
 not
   fail the build. My guess would be that he is expecting some kind of
 on
   failure/on tests failure phase where he could attach other maven
  plugins
   to perform alternate behaviour.
  
   Unfortunately I have no idea on how this could be done. Probably using
  Ant
   or by writing your own plugin, but I find both solutions quite poor.
  Maybe
   Maven is not the tool to be used to perform this. Although you can do
 a
  lot
   of things with Maven, sometimes bending its original objectives too
 far
   away is just cumbersome and counter-productive /(not sure this
 english,
   btw).
  
   /Cheers,
   Guillaume
   Le 10/01/2012 17:22, Jeff MAURY a écrit :
  
what about
  
 
 http://maven.apache.org/**plugins/maven-surefire-plugin/**test-mojo.html#
   **testFailureIgnore
 
 http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#testFailureIgnore
  
  
   Jeff MAURY
  
   On Tue, Jan 10, 2012 at 4:55 PM, Xavier S.xavier.seign...@gmail.com
  **
   wrote:
  
Thanks for all your answers, but I think I should re explain my
 need.
  
   I don't want to skip the tests. The default fail fast mode of maven
  suits
   me (section 6.1.8
  
   http://www.sonatype.com/books/**mvnref-book/reference/running-**
   sect-options.html
 
 http://www.sonatype.com/books/mvnref-book/reference/running-sect-options.html
  
   ).
  
   I just want to run my custom mojo just after my tests failures and
  just
   before the end of the maven execution (if there is build failures,
  maven
   do
   not even finishes the current test phase).
  
   Regards,
  
   Xavier
  
  
  
  
  
 
 



Re: How to run a maven goal when there is tests failures?

2012-01-10 Thread Xavier S.
I'm not sure it will work since when there is test failures the test phase
is not executed completely and stops on the failing goal within that phase.

Regards,

Xavier

2012/1/11 Yuvaraj Vanarase yuvaraj.vanar...@synechron.com

 -  One has to write custom goal and attach to the test phase of
 maven build life cycle. Goal checks if test failure and do the action.

 http://maven.apache.org/guides/plugin/guide-java-plugin-development.html





 Regards,

 Yuvaraj





 -Original Message-
 From: Xavier S. [mailto:xavier.seign...@gmail.com]
 Sent: Tuesday, January 10, 2012 5:45 PM
 To: Maven Users List
 Subject: How to run a maven goal when there is tests failures?



 Hello,



 I would like to know if there is a way to execute a goal when there is test

 failures?



 Since maven stops its execution (fail fast mode) after encountering a test

 failure, is there any options to launch a goal between that test failure

 and he stop of maven?



 Regards,

 Xavier.