If ant just overwrites the changed files, I think deployer will see the difference, undeploy the application, then redeploy. So you do not have to delete entire directory.
Yes, but when you copy, files/dirs that aren't needed anymore, will not be deleted, they just remain. That's why I need to delete my entire app.war/ directory.
Nick, you state that some jar files cannot be deleted. Is that because they are in use? If so, the most likely cause is that the app server is holding on to session information for sessions that have not yet timed out.
Try this. Set the session-timeout in web.xml to a low number, like 1. Then deploy the the web.xml file. This should cause JBoss to redeploy the app. Wait about 5 seconds (the default time used by hot-deploy, adjust if you changed that time), and then try deleting the directory. Try it by hand first, and if it works, it should be fairly simple to teach ant how to do this.
It doesn't seem to work.
<session-config> <session-timeout>1</session-timeout> </session-config>to web.xml; the app was redeployed. I waited long enough to make it time out and then I tried to delete the dir: the JARs are still in use.
The web app is one for Web Start with in WEB-INF/lib jardiff.jar, jnlp.jar, jnlp-servlet.jar and one of mine. None of them can be deleted.
Lets try to start over on this topic.
You have an exploded war. You want to be able to undeploy the applicaiton, make changes to the content of this war, then redeploy, correct?
However, you do not want to delete some jar's, correct? please explain why you can't just delete the old war directory. I am missing something about your environment that does not make sense, that is why I need you to explain this.
OK, let's try something else. Try undeploying your application via the undeploy method on the jboss.system:service=MainDeployer mbean. The undeploy method takes a URL, which you can find using the listDeployedURLs method in the jboss.deployment:flavor=URL,type=DeploymentScanner mbean. Do this manually using the jmx-console, and then see if you can delete the jar files. If that works, the above steps can be scripted in ant, though the script is a little more unusual.