You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Kyle Adams <ka...@gfs.com> on 2002/01/04 15:09:09 UTC
Skipping empty JARs
I've run into an odd problem recently with the "whenempty" attribute of the <jar> task.
The following test ant script, when run in a directory containing ONLY the build.xml file,
creates both jars. This puzzles me; as best I understand the <jar> task, it seems like
creation of the second jar should be skipped. When I open the jar, it's empty (excepting
the Ant-generated manifest file). It seems like this problem popped up recently; I don't
remember having it under Ant 1.3. I'm currently using Ant 1.4 (compiled on September
3 2001).
Bug or (more likely) user error?
Kyle
build.xml
==========
<project name="test" basedir="." default="package">
<target name="clean">
<delete>
<fileset dir="${basedir}">
<include name="*.jar"/>
</fileset>
</delete>
</target>
<target name="package" depends="clean">
<jar jarfile="${ant.project.name}1.jar" whenempty="skip">
<fileset dir="${basedir}">
<include name="*.xml"/>
</fileset>
</jar>
<jar jarfile="${ant.project.name}2.jar" whenempty="skip">
<fileset dir="${basedir}">
<include name="*.html"/>
</fileset>
</jar>
</target>
</project>
build results (with -debug)
========================
package:
FileSet: Setup file scanner in dir D:\Dev3\scripts\perl with patternSet{ includes: [*.xml] excludes: [] }
[jar] Updating jar since cannot read current jar manifest: java.util.zip.ZipExceptionThe system cannot find the file specified
[jar] Building jar: D:\Dev3\scripts\perl\test1.jar
FileSet: Setup file scanner in dir D:\Dev3\scripts\perl with patternSet{ includes: [*.xml] excludes: [] }
FileSet: Setup file scanner in dir D:\Dev3\scripts\perl with patternSet{ includes: [*.html] excludes: [] }
[jar] Updating jar since cannot read current jar manifest: java.util.zip.ZipExceptionThe system cannot find the file specified
[jar] Building jar: D:\Dev3\scripts\perl\test2.jar
FileSet: Setup file scanner in dir D:\Dev3\scripts\perl with patternSet{ includes: [*.html] excludes: [] }
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>