ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Adams" <kad...@gfs.com>
Subject Skipping empty JARs
Date Fri, 04 Jan 2002 14:09:09 GMT
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:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message