ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RADEMAKERS Tanguy <>
Subject Re: How to redirect javac task errors to a separate file
Date Wed, 11 Feb 2004 21:04:00 GMT
use <record ... loglevel="warn"> around the <javac> task.


Digambar, Shaligram (Consultant) wrote:

>I need to redirect ant javac tasks error output to a separate file.
>Currently all javac messages are logged in the output. I need to log only
>the compiler error message (shown in bold and marked 'M"below) to a separate
>file so that developers in a team can easily identify and fix the errors.
>With the javac executable there was easy way to redirect output into
>separate file e.g. $javac 2> error.txt  or $javac 1>
>warning.txt. I don't see any such feature in ant.
>Here is the sample javac task output:
>    [javac] Since fork is true, ignoring compiler setting.
>    [javac] Compiling 1 source file to C:\build
>    [javac] depend attribute is not supported by the modern compiler
>    [javac] Since fork is true, ignoring compiler setting.
>    [javac] [parsing started C:\build\]
>    [javac] [parsing completed 312ms]
>    M[javac] C:\build\ class test is public, should be
>declared in a file named
>    M[javac] public class test
>    M[javac]        ^
>    [javac] [loading C:\jdk1.3.1_10\jre\lib\rt.jar(java/lang/Object.class)]
>    [javac] [loading C:\jdk1.3.1_10\jre\lib\rt.jar(java/lang/String.class)]
>    [javac] [loading C:\jdk1.3.1_10\jre\lib\rt.jar(java/util/Vector.class)]
>    [javac] [loading C:\jdk1.3.1_10\jre\lib\rt.jar(java/lang/Thread.class)]
>Please let me know if it is possible to implement this in ant.
>This email may contain confidential and privileged material for the sole use of the intended
recipient(s). Any review, use, retention, distribution or disclosure by others is strictly
prohibited. If you are not the intended recipient (or authorized to receive for the recipient),
please contact the sender by reply email and delete all copies of this message.  Also, email
is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses.
We only send and receive emails on the basis that we are not liable for any such corruption,
interception, tampering, amendment or viruses or any consequence thereof.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message