ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xsli2 <>
Subject How to turn off the warnings during ant build?
Date Wed, 04 Apr 2012 13:23:24 GMT

When I run ant, a lot of warnings are printed out on the screen. It is very
daunting. It makes new people to feel, as first response, this is broken.
But actually, the build is successful. I pasted a few warning messages
below. In our real code, there are hundreds of them.

    [javac] /abc/efg/ warning: [unchecked] unchecked call
to add(E) as a member of the raw type java.util.List
    [javac]             recursiveDirectoriesToBuild.add(workingDir);
    [javac]                             ^
    [javac] /abc/efg/ warning: [unchecked] unchecked call
to Vector(java.util.Collection<? extends E>) as a member of the raw type
    [javac]             return new Vector(v2);

I know one solution, the basic solution, is to going to the code and use
Java Annotation feature to add "Ignore Warning etc" at those places. But
there are so many places and the code were written by different people. We
don't want to modify the code! I am wondering if ant has a feature to turn
off the warning messages. 

This is my ant script to build:
	<target name="compile" depends="prepare">
		<javac srcdir="${src.dir}" destdir="${build.dir}" compiler="modern"
fork="yes" debug="on">
			<classpath refid="project.classpath"/>
			<compilerarg value="-Xlint"/>

To be honest, I do not know the feature "-Xlint" etc.

Thank you very much.

View this message in context:
Sent from the Ant - Users mailing list archive at

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

View raw message