ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen McConnell" <mcconn...@dpml.net>
Subject RE: Cannot delete file from classpath.
Date Thu, 17 Aug 2006 15:56:10 GMT
 

> -----Original Message-----
> From: Langanke, Frank [mailto:frank.langanke@etvice.com] 
> Sent: Thursday, 17 August 2006 9:23 PM
> To: user@ant.apache.org
> Subject: Cannot delete file from classpath.
> 
> Hi,
> 
> I have a project A which depends on a jar from another 
> project B. The problem is that I got the jar from project B 
> in the classpath of project A; at start my clean target tries 
> to delete the jar but fails because the file is in the 
> classpath. I don't know how to update the jar (how to delete it).

Frank:

If your running on windows the normal behaviour is that if you create a
classloader referencing a jar, the classloader maintains an open file
reference preventing the file from deletion.  The only way around this is to
ensure that you don't hold a reference to the file unless your actually
using it.  You can achieve this by separating your build into two distinct
projects where B is build before project A and project A references the jar
file produced by B  under an appropriate path statement.  You then need to
define project X which does the sequencing of B then A.

Cheers, Steve.


--------------------------
Stephen McConnell
mailto:mcconnell@dpml.net
http://www.dpml.net
 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message