ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <>
Subject Re: java task doesn't generate the *.class when compilation fails
Date Tue, 02 Sep 2003 18:41:26 GMT
I would thinks that the behavior you are describing is from javac, not from
To change this, you should somehow (for instance using <apply/>) compile
your sources one by one.

My advice would be :
- if some source files never compile and nobody in your team wants to fix
them, then they are useless and should be removed,

- if some source files are checked in and produce compilation errors,
someone (build manager) should liaise with the developers and make them fix
the faulty source files,

- depending on the size of your project (s), you could install CruiseControl
or AntHill to get near time or real time compilations. These 2 pieces of
software are built on top of ant. There are other solutions too, but I do
not know all of them. The advantage of such systems is that, if you have a
small size project and you have unattended builds starting automatically say
every 15 minutes when code has changed, chances are that you will able to
make developers fix their code [ for build purposes at least ] very quickly,
rather than discovering 20 errors in a nightly build.

----- Original Message -----
From: "David" <>
To: "Ant Apache User List" <>
Sent: Tuesday, September 02, 2003 7:59 PM
Subject: java task doesn't generate the *.class when compilation fails

> Dear members,
> I have tested that ant creates the *.class if all files to be compiled
> compiles without error, otherwise if the java compiler finds some errors,
> non *.class will be  generated. I expected at least that the *.class files
> wil be generated corresponding to the files without errors.
> Is it any way to chanage this behaviour?.
> I have set the attribute: failonerror to false.
> Thanks in advance,
> David
> Note: I am using the following invokation:
>  <target name = "compile-src" depends = "init">
>         <!-- Compile Java classes as necessary -->
>         <javac
>             classpathref        = "compile.classpath"
>             debug               = "${compile.debug}"
>             deprecation         = "${compile.deprecation}"
>             destdir             = "${class}"
>             includeAntRuntime   = "yes"
>             failonerror         = "false"
>             source              = "${compile.source}"
>             srcdir              = "${src}"
>             optimize            = "${compile.optimize}">
>             <include name = "**/*.java"/>
>         </javac>
>     </target>
> where:
> compile.debug       = true
> compile.deprecation = true
> compile.optimize    = false
> compile.source      = 1.3

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

View raw message