I'm performing a build that is "automated" on a test server and everything is going ok. I grab my source from StarTeam, compile it, war it, ear it, then try to delete the working directories. I can delete everything (including my compiled code directories) until I hit this...
The code in my xml for this is:
Any Suggestions? Is this because it is an Apache .jar file (we're also using STRUTS)? I want to delete the directories completely so that when I create another build, I don't have pieces of previous builds lying around... THanks! [ March 11, 2003: Message edited by: Sam Smoot ]
Are you working on a Windows platform? If so, verify that the jar's read only property isn't on. I've had that cause problems for me.
Joined: Apr 18, 2002
Well, it is Win2k, but the files show as not locked either on the server or the repository (StarTeam). Any other suggestions? Thanks! By the way.. the version of ANT is : Apache Ant version 1.5 compiled on July 9 2002 [ March 11, 2003: Message edited by: Sam Smoot ]
Unfortunately, Windows 2000 does this. It complains if any other application has the file open, and refuses to delete it. The work around (such as it is) is to make sure that nothing has the file open. For a jar file, that means making sure that no running JVM had it in the classpath.
That figures.. boy, that Billy G. is a funny guy ain't he ..... Actually, nothing should have it since it is actually in a temporary directory created just for the build. I guess I need to call another .bat file to delete the directories when I'm done.. OF COURSE, if I had a BOOK about how to develop with ANT on HAND, I could probably do better....
Joined: Apr 18, 2002
Fixed it... Had to remember how to write "advanced" batch file.. Using rmdir after build finishes. Thanks for the suggestions and help!
Joined: Jan 07, 1999
Actually, nothing should have it since it is actually in a temporary directory created just for the build. Ah, but is that directory, or a jar file in it, in any classpath used by Ant? That's where the problem usually comes from :- Ant itself has "claimed" the file or directory.
I had the same problem just with my own homemade Ant script (not an Eclipse problem or anything like that). I tried everything from file access to voodo incantations and nothing seemed to work.
Then one day as I was just about to give up and explore a new career in vetrenary psycology, it dawned on me... Ant is written in Java! That means it uses classpath. That means if my .jar file is in the classpath than Ant's JVM is probably preloading it, and if its in use, then OF COURSE you can't delete it.
Sure enough, my classpath was ".;c:\jdk;yadda yadda" I removed the ".;"
We're pleased to have swung your way over to be with us here on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please grab another vine and swing on over to the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.