On Thu, Sep 27, 2007 at 01:16:25PM -0300, Martin Alejandro Villalobos spake 
thus:
> Hello, I have a question.
> I want write a little script in linux that detect when maven is 
> returning build failure?
> Somebody knows how I can do it?
> 
> Thaks to all and cheers.
> 
> Martin.

-----------------------------8<------------------------------
#!/bin/sh

PROG='whatever'
trap 'printf "$PROG (WARN): HUP signal caught; bailing out\n"  1>&2; exit 1' HUP
trap 'printf "$PROG (WARN): INT signal caught; bailing out\n"  1>&2; exit 1' INT
trap 'printf "$PROG (WARN): QUIT signal caught; bailing out\n" 1>&2; exit 1' 
QUIT
trap 'printf "$PROG (WARN): TERM signal caught; bailing out\n" 1>&2; exit 1' 
TERM

mvn clean install
if test $? -ne 0; then
    printf "${PROG} (ERROR): maven build failed\n" 1>&2
    exit 1
fi
-----------------------------8<------------------------------

Customize to suit...

HTH,
-Al

-- 
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
::
Alan D. Salewski
Software Developer
Health Market Science, Inc.
:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
:: 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to