• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

deleting directories in ant

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a target in ant that deleted my temporary build directory. However, I was getting an error saying it couldn't delete the jar files contained there. If I let the build file run to its completion and then run 'ant clean' from the command line, then it works no problem. Its like there is still some sort of thread running against the jars the first time the clean target is called. DOes anyone know how to get around this?
 
Sheriff
Posts: 3036
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen a similar problem a few times, and have just assumed it's a Windows problem. There are times when I can't delete a file or directory through File Explorer either. Sometimes the problem goes away after awhile, and sometimes I have to log out and in again. It hasn't happened to me since I got a new machine, although I'm still using Windows 2000 Pro. Maybe I have a newer service pack?
Here's some things to try:
1) Make sure no process is using the jar. Your app server should be shut down.
2) Make sure no process is using the directory. In particular, don't have any DOS command lines sitting in that directory.
3) Set failonerror to false. At least then the rest of your clean script can run.
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've had the same problem deleting files on Windows 2000. It seems like it takes Windows a little longer to realize that no process is using the file than it should. I generally don't run my clean target as part of the build, so I haven't run into problems with Ant as a result.
 
He was giving me directions and I was powerless to resist. I cannot resist this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic