ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Sampson" <jsamp...@covia.com>
Subject Error with jar task: A zip file cannot include itself (Ant 1.3)
Date Thu, 08 Mar 2001 01:20:19 GMT
I've encountered a strange problem with the jar task in Ant 1.3. The problem
does not seem to occur in 1.2.

The problem was during a jar task which was building a jar of a directory in
the directory itself:

    <jar jarfile="foo/foo.jar" basedir="foo" />

Ant seemed to be trying to include the jar file in itself, giving the error
"A zip file cannot include itself". The jar didn't exist before running (and
would have been deleted by a preceding delete task if it did exist). This
error cause the build to fail, with foo/foo.jar having been created with a
manifest and some but not all of the files in foo/.

Anyway, I got around the problem by adding an "excludes" attribute to the
jar task:

    <jar jarfile="foo/foo.jar" basedir="foo" excludes="foo.jar" />

But I'm wondering if this is a bug, and what has changed from 1.2.

Justin Sampson
CoVia Technologies


Mime
View raw message