ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ventimiglia, David" <David.Ventimig...@msdw.com>
Subject Problems with <jar> task
Date Thu, 09 Nov 2000 19:13:41 GMT
> Hi,
> 
> I'm getting many instances of this sort of error when trying to use the
> <jar> task:
> 
> Building jar: C:\deploy_root\foo.jar
> 
> BUILD FAILED
> 
> m:\dventimiglia_coreFoo_V1_integration\coreFoo\build.xml:165: Problem
> creating jar: duplicate entry: com/foo/online/aba/metro/AccountData.class
> java.util.zip.ZipException: duplicate entry:
> com/foo/online/aba/metro/AccountData.class
> 	at
> java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:165)
> 	at org.apache.tools.ant.taskdefs.Zip.zipFile(Zip.java:359)
> 	at org.apache.tools.ant.taskdefs.Zip.zipFile(Zip.java:374)
> 	at org.apache.tools.ant.taskdefs.Jar.zipFile(Jar.java:143)
> 	at org.apache.tools.ant.taskdefs.Zip.addFiles(Zip.java:212)
> 	at org.apache.tools.ant.taskdefs.Zip.execute(Zip.java:169)
> 	at org.apache.tools.ant.Target.execute(Target.java:142)
> 	at org.apache.tools.ant.Project.runTarget(Project.java:818)
> 	at org.apache.tools.ant.Project.executeTarget(Project.java:532)
> 	at org.apache.tools.ant.Project.executeTargets(Project.java:506)
> 	at org.apache.tools.ant.Main.runBuild(Main.java:420)
> 	at org.apache.tools.ant.Main.main(Main.java:149)
> 
> This happens when I try to use nested <fileset> elements with internally
> nested <include> and <exclude> elements, as in:
> 
>   <target name="jar" depends="init,classes">
>     <jar jarfile="${deploy.root}/foo.jar"
>          basedir="${build.dir}"
>          compress="${jar.compress}"
>          excludes="**/*Bean.class">
>       <fileset dir="${build.dir}">
>          <exclude name="**/*Bean.class"/>
>       </fileset>
>     </jar>
>   </target>
> 
> However, it works fine if I remove the nested <fileset> and collapse the
> "exclude" into the JAR task, as in:
> 
>   <target name="jar" depends="init,classes">
>     <jar jarfile="${deploy.root}/foo.jar"
>          basedir="${build.dir}"
>          compress="${jar.compress}"
>          excludes="**/*Bean.class"/>
>   </target>
> 
> Does anyone know why this might be happening?  Obviously, with only one
> "exclude" the collapsed version is simpler, but when I have many includes
> and excludes, I would like to use nested filesets.  I think this error is
> being emitted by jar.exe, but only because the <jar> task in Ant is not
> using it in a way that it likes to be used.  Since it appears <jar> does
> not log what files are discovered, the way <javac> helpfully does (even
> with -verbose or -debug options), it's hard for me to know how jar.exe is
> being used.
> 
> Thanks!
> 
> Cheers,
> David
> 
> 
> 

Mime
View raw message