Thank you Dan,
I can serve a purpose.
I use cat instead of grep.

----callmaven.sh----
#!/bin/sh

LOG=callmaven.log

returncode=0
RCODEFILE=${MAVEN_HOME}/.callmaven.$$.rcode

callmaven () {
  ${MAVEN_HOME}/bin/maven $*
  returncode=$?
  echo "callmaven code check point 1: ${returncode}"
  echo "${returncode}" > ${RCODEFILE}
}

callmaven 2>&1 | tee -a ${LOG}

returncode=`cat ${RCODEFILE}`
rm -fr ${RCODEFILE}

echo "callmaven code check point 2: ${returncode}"
exit ${returncode}
---------------------

Thanks.


dan tran wrote:
you are right it is not working for me either. sorry about that.
how about this hack?

echo someunique string in your log to indicate error, then do a grep on the file ;-) then check grep return code

-D

On 8/11/05, Keisuke Matsubara <[EMAIL PROTECTED]> wrote:

Thank you dan,

I had tried your suggestion on hpux 11i. But the return code probrem
have not been resolved. script calling maven can take correct return
code from maven.

I create a script calling maven like following.
ui.sh --> callmaven.sh --> maven

When maven return not zero ,the code at point1 is correct code, but the
code at point2 is zero.
I know that this is my script probrem ,not maven probrem.

----callmaven.sh----
#!/bin/sh

returncode=0

callmaven () {
 ${MAVEN_HOME}/bin/maven -e ${_CMD_OPTIONS}
 returncode=$?
 echo "callmaven code check point 1: ${returncode}"
 export returncode
 exit ${returncode}
}

callmaven 2>&1 | tee -a ${LOG}

echo "callmaven code check point 1: ${returncode}"
exit ${returncode}
---------------------

Thanks.


dan tran wrote:

quick suggestion, put maven around a () block

(
 maven xxxxx
 set error code or call exit(erorr code) here
) 2>&1 | tee $logfile


check for error


On 8/10/05, Keisuke Matsubara <[EMAIL PROTECTED]> wrote:


Thank you Edwin.

Now I use redirection with tee command like you. Because I want to
record log and output to console. But when I use tee command , the
script calling maven can take correct return code from maven. (It always
take 0).

I have searched good way to record than redirection.

Thanks.


Edwin Punzalan wrote:


Try using the OS ">" redirection.

For example: maven compile > log.txt


Keisuke Matsubara wrote:




Hi,

If someone has some information ,can you give me a hint.

Thanks

-------- Original Message --------
Subject: [M1] How to output java:compile log to file
Date: Wed, 10 Aug 2005 19:31:41 +0900
From: Keisuke Matsubara <[EMAIL PROTECTED]>
Reply-To: Maven Users List <users@maven.apache.org>
Organization: NEC Corporation
To: users@maven.apache.org

Hi,

I am searching how to output compile log to some log file.
Is there some solution for my probrem.

I had tried editing log4j.properties (add original appender ,change
setting of log4j.category.org.apache.commons.jelly.tags.ant) in
maven.jar ,but compile logs had not been recorded.

Does someone have any idea?

maven 1.0.2
maven-java-plugin-1.5

Thanks and Regards,
Keisuke





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



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




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



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




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



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

Reply via email to