You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by xsli2 <xs...@yahoo.com> on 2012/04/04 15:23:24 UTC

How to turn off the warnings during ant build?

Hi:

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/MyTools.java:125: 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/MyTools.java:212: warning: [unchecked] unchecked call
to Vector(java.util.Collection<? extends E>) as a member of the raw type
java.util.Vector
    [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"/>
		</javac>
	</target>

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

Thank you very much.


--
View this message in context: http://ant.1045680.n5.nabble.com/How-to-turn-off-the-warnings-during-ant-build-tp5617771p5617771.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: How to turn off the warnings during ant build?

Posted by Knuplesch, Jürgen <Ju...@icongmbh.de>.
Just add the javac options that reduce the javac warnings into your javac task.
This javac who tells you whats wrong, not Ant himself.

-----Ursprüngliche Nachricht-----
Von: xsli2 [mailto:xsli2@yahoo.com] 
Gesendet: Mittwoch, 4. April 2012 15:23
An: user@ant.apache.org
Betreff: How to turn off the warnings during ant build?

Hi:

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/MyTools.java:125: 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/MyTools.java:212: warning: [unchecked] unchecked call to Vector(java.util.Collection<? extends E>) as a member of the raw type java.util.Vector
    [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"/>
		</javac>
	</target>

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

Thank you very much.


--
View this message in context: http://ant.1045680.n5.nabble.com/How-to-turn-off-the-warnings-during-ant-build-tp5617771p5617771.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org