I write an ant script to update jar file, and it works well on Linux.  However, when I run that on Windows machine, I got a strange error "unable to rename old file".

My script is like this,
<jar destfile="foo.jar" basedir="${dest.dir}" includes="Provider.class" update="true"/>
<move file="foo.jar" tofile="bar.jar"/>

In this snip, I want to update foo.jar with Provider.class, and rename it to bar.jar.

After some search, I fix this problem in this way...
<jar destfile="bar.jar">
      <fileset dir="${dest.dir}" includes="Provider.class" />
       <zipfileset src="foo.jar"/>           
</jar>

Technorati Tags: ant


0 comments:

Newer Post Older Post Home