Unable to delete WEB-INF\\lib\*.jar using ant
843836Mar 10 2005 — edited Oct 25 2005Using ant to build struts.
This is part of the build.xml for struts-example.war
<property name="deploy.dir" value="${tomcat.home}/webapps"/>
<target name="cleanWebApp">
<delete file="${deploy.dir}/${war.file.name}" />
<delete dir="${deploy.dir}/${war.file}" includeEmptyDirs="true" />
</target>
But when I try to build and reload it to tomcat, it gives me errors:
cleanWebApp:
[delete] Deleting: D:\jakarta-tomcat-5.5.7\webapps\struts-example.war
[delete] Deleting directory D:\jakarta-tomcat-5.5.7\webapps\struts-example
BUILD FAILED
D:Java\code\struts\strutsexamples\build.xml:46: Unable to delete file D:\jakarta-tomcat-5.5.7\webapps\struts-example\WEB-INF\lib\commons-digester.jar
Also lib\struts.jar(maybe more) can't be deleted.
Now I have to stop tomcat, delete it manually, and reinstall the war.
How can I fix this problem?