# ant-user mailing list archives

##### Site index · List index
Message view
Top
From Judy Anderson <JAnder...@rocketsoftware.com>
Subject RE: CVS task failure: cannot rename
Date Wed, 02 Jan 2008 15:02:50 GMT
```Aha, indeed, the jar file was on my classpath.  In my experiments I didn't explicitly change
classpath within Ant, but I suppose it inherits from the environment.  I rebooted my machine
and the problem went away, but I may not have run the script that sets my default classpath
when I ran the after-reboot test.  Thanks for the tip.  I guess I need to rework stuff so
that I make sure no CVS-controlled files are on classpath before running the CVS tasks, and
then re-add them when it's time to run the tasks that will require the new jars.

-----Original Message-----
Sent: Sunday, December 30, 2007 3:09 PM
To: Ant Users List
Subject: RE: CVS task failure: cannot rename

> From: Judy Anderson [mailto:JAnderson@rocketsoftware.com]
> Sent: Tuesday, December 25, 2007 1:51 PM
> To: Ant Users List
> Subject: RE: CVS task failure: cannot rename
>
> I have done some more experimentation with my problem.  It
> only happens on binary files (flag "-kb").  CVS is doing a
> different kind of update that involves delete/rename.  I
> tried using <exec> on cvs with no help.
>
> It seems that, although I can "del" such a file manually, I
> cannot use ant's <delete> task on one.  So perhaps the
> problem is unrelated to CVS (well, excepting that the file
> was created by CVS.)
>
> <delete file="c:/bt/mainline/bundle/bundle.jar"/>
>
>    [delete] Deleting: c:\bt\mainline\bundle\bundle.jar
>
> BUILD FAILED
> build.xml:9: Unable to delete file c:\bt\mainline\bundle\bundle.jar
>
> So, now I wonder if there's some weirdness within Ant about
> user permissions.  I can delete a file I created by hand.  I
> cannot see any interesting difference in the Properties
> dialog for either of these files in the explorer.  (The CVS
> created files have a "Summary" tab, but my files don't.  It
> is blank.)  I'm really mystified.  I wish that I had the
> Windows error code that led the <delete> task to decide it
> could not delete the file.

Judy,

Is it possible that the files in question are .jar files that are on the
classpath of other tasks that have been run during the build? If so,
it's possible that the JVM still has the .jar file open, in which case
you will not be able to delete it.
--
Rick Genter
Principal Software Engineer