You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mick Knutson <mi...@gmail.com> on 2007/08/06 22:10:11 UTC

[m2] How to catch errors when running mvn?

I want to be able to catch an error in a batch script when I run the
following command:

@call mvn clean install -e

so how could I do something like:

%local-error% = @call mvn clean install -e

then test %local-error% != 1



-- 

Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

RE: [m2] How to catch errors when running mvn?

Posted by Andrew Boyer <ab...@Endeca.com>.
A good example of how to do this is in the mvn.bat batch file.  Open it
up, search for "Start MAVEN2", and then notice how it checks the return
value.  Also notice that you'll need to set the environmental variable
MAVEN_TERMINATE_CMD for the batch file to return errors.

Andrew

> -----Original Message-----
> From: Mick Knutson [mailto:mickknutson@gmail.com]
> Sent: Monday, August 06, 2007 4:10 PM
> To: maven
> Subject: [m2] How to catch errors when running mvn?
> 
> I want to be able to catch an error in a batch script when I run the
> following command:
> 
> @call mvn clean install -e
> 
> so how could I do something like:
> 
> %local-error% = @call mvn clean install -e
> 
> then test %local-error% != 1
> 
> 
> 
> --
> 
> Thanks,
> Mick Knutson
> 
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---

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