You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by "Imner, Andreas" <An...@kgk.se> on 2010/04/16 11:25:48 UTC

Why is Ivy locking my resolved dependencies until Ant finishes processing?

Hi 

I have a problem with Ivy that is blocking me from using it for creating my daily builds. I am using Windows and this problem does not appear on, for example, MacOS.

My daily build -Ant target triggers (among others), the following Ant targets
1. clean - cleaning /build and /lib
2. test  - resolving 3:rd party dependencies (conf="test") using Ivy to /lib, compiling classes + test classes and executing the junit tests
3. release - cleaning /build and /lib, resolving 3:rd party dependencies (conf="run") using Ivy, compiling the classes and assembling my webapp.

When running these targets within the same Ant "session" (like "/> ant clean test release") or when calling these targets from a single target, using the "ant" -task the following happens in the beginning of the "release" -target:

C:\dev\trunk\04_Implementation\webshop-ng\build.xml:228: Unable to delete file C:\dev\trunk\04_Implementation\webshop-ng\lib\activation-1.1.1.jar

But if I run the targets one by one, like 
ant clean
ant test
ant release
... the problems does not appear

If I add a <sleep minutes="5"/> to my build.xml and the use handle.exe, a sysinternals program for checking file handles, I can see that the Ant java process has file handles open for all the resolved 3rd party jars in /lib

Also as a test, during the <sleep.../>, I tried deleting the files in /lib using Windows explorer, but of course this didn't work either.

Does anyone have a solution or suggestion for this issue? I don't think Im the only one using windows and multiple targets withing the same Ant "session"?


Regards,

Andreas Imner 


SV: Why is Ivy locking my resolved dependencies until Ant finishes processing?

Posted by "Imner, Andreas" <An...@kgk.se>.
I did some more testing regarding this and found out the real cause of the problem and the problem was me/Ant, not Ivy :-)

Earlier, I created the classpath for my <junit...> -task from 3rd party dependencies that was residing in an external directory and I only "cleaned" the /build directory.

When I started using Ivy, I used ivy:resolve tol "download" the .jars to lib and then I executed the <junit..> task, setting the classpath to all jars in /lib.

In a later step I would then "clean" the /build and /lib and for some reason it seems that my <junit ..> task (with fork="yes") would not let go of the files in the /lib folder unit the Ant process finished...

I will now try to use Ivys <cachepath..> task instead


Regards,

Andreas Imner 

-----Ursprungligt meddelande-----
Fr?n: Maarten Coene [mailto:maarten_coene@yahoo.com] 
Skickat: den 17 april 2010 23:32
Till: ivy-user@ant.apache.org
?mne: Re: Why is Ivy locking my resolved dependencies until Ant finishes processing?

I don't know, maybe you didn't had this problem before because you were using subant to call these targets? As far as I know, Ivy isn't locking any jars. If it does, it is a bug that should get fixed.

Btw, did forking the junit/javac tasks solve the problem?

Maarten




----- Original Message ----
From: "Imner, Andreas" <An...@kgk.se>
To: "ivy-user@ant.apache.org" <iv...@ant.apache.org>
Sent: Fri, April 16, 2010 11:27:11 PM
Subject: Re: Why is Ivy locking my resolved dependencies until Ant finishes processing?

But before I started using Ivy for resolving the dependencies there  
were no file locking (see my reply that I wrote a short while ago).

Regards
Andreas



16 apr 2010 kl. 21.46 skrev "Maarten Coene" <ma...@yahoo.com>:

> My guess is that the VM is locking the jars in your lib directory  
> after step 2 (compilation or executing the junit tests).
> Did you fork the javac and junit tasks?
>
> Maarten
>
>
>
>
> ----- Original Message ----
> From: "Imner, Andreas" <An...@kgk.se>
> To: "ivy-user@ant.apache.org" <iv...@ant.apache.org>
> Sent: Fri, April 16, 2010 11:25:48 AM
> Subject: Why is Ivy locking my resolved dependencies until Ant  
> finishes processing?
>
> Hi
>
> I have a problem with Ivy that is blocking me from using it for  
> creating my daily builds. I am using Windows and this problem does  
> not appear on, for example, MacOS.
>
> My daily build -Ant target triggers (among others), the following  
> Ant targets
> 1. clean - cleaning /build and /lib
> 2. test  - resolving 3:rd party dependencies (conf="test") using Ivy  
> to /lib, compiling classes + test classes and executing the junit  
> tests
> 3. release - cleaning /build and /lib, resolving 3:rd party  
> dependencies (conf="run") using Ivy, compiling the classes and  
> assembling my webapp.
>
> When running these targets within the same Ant "session" (like "/>  
> ant clean test release") or when calling these targets from a single  
> target, using the "ant" -task the following happens in the beginning  
> of the "release" -target:
>
> C:\dev\trunk\04_Implementation\webshop-ng\build.xml:228: Unable to  
> delete file C:\dev\trunk\04_Implementation\webshop-ng\lib 
> \activation-1.1.1.jar
>
> But if I run the targets one by one, like
> ant clean
> ant test
> ant release
> ... the problems does not appear
>
> If I add a <sleep minutes="5"/> to my build.xml and the use  
> handle.exe, a sysinternals program for checking file handles, I can  
> see that the Ant java process has file handles open for all the  
> resolved 3rd party jars in /lib
>
> Also as a test, during the <sleep.../>, I tried deleting the files  
> in /lib using Windows explorer, but of course this didn't work either.
>
> Does anyone have a solution or suggestion for this issue? I don't  
> think Im the only one using windows and multiple targets withing the  
> same Ant "session"?
>
>
> Regards,
>
> Andreas Imner
>
>
>



      

Re: Why is Ivy locking my resolved dependencies until Ant finishes processing?

Posted by Maarten Coene <ma...@yahoo.com>.
I don't know, maybe you didn't had this problem before because you were using subant to call these targets? As far as I know, Ivy isn't locking any jars. If it does, it is a bug that should get fixed.

Btw, did forking the junit/javac tasks solve the problem?

Maarten




----- Original Message ----
From: "Imner, Andreas" <An...@kgk.se>
To: "ivy-user@ant.apache.org" <iv...@ant.apache.org>
Sent: Fri, April 16, 2010 11:27:11 PM
Subject: Re: Why is Ivy locking my resolved dependencies until Ant finishes processing?

But before I started using Ivy for resolving the dependencies there  
were no file locking (see my reply that I wrote a short while ago).

Regards
Andreas



16 apr 2010 kl. 21.46 skrev "Maarten Coene" <ma...@yahoo.com>:

> My guess is that the VM is locking the jars in your lib directory  
> after step 2 (compilation or executing the junit tests).
> Did you fork the javac and junit tasks?
>
> Maarten
>
>
>
>
> ----- Original Message ----
> From: "Imner, Andreas" <An...@kgk.se>
> To: "ivy-user@ant.apache.org" <iv...@ant.apache.org>
> Sent: Fri, April 16, 2010 11:25:48 AM
> Subject: Why is Ivy locking my resolved dependencies until Ant  
> finishes processing?
>
> Hi
>
> I have a problem with Ivy that is blocking me from using it for  
> creating my daily builds. I am using Windows and this problem does  
> not appear on, for example, MacOS.
>
> My daily build -Ant target triggers (among others), the following  
> Ant targets
> 1. clean - cleaning /build and /lib
> 2. test  - resolving 3:rd party dependencies (conf="test") using Ivy  
> to /lib, compiling classes + test classes and executing the junit  
> tests
> 3. release - cleaning /build and /lib, resolving 3:rd party  
> dependencies (conf="run") using Ivy, compiling the classes and  
> assembling my webapp.
>
> When running these targets within the same Ant "session" (like "/>  
> ant clean test release") or when calling these targets from a single  
> target, using the "ant" -task the following happens in the beginning  
> of the "release" -target:
>
> C:\dev\trunk\04_Implementation\webshop-ng\build.xml:228: Unable to  
> delete file C:\dev\trunk\04_Implementation\webshop-ng\lib 
> \activation-1.1.1.jar
>
> But if I run the targets one by one, like
> ant clean
> ant test
> ant release
> ... the problems does not appear
>
> If I add a <sleep minutes="5"/> to my build.xml and the use  
> handle.exe, a sysinternals program for checking file handles, I can  
> see that the Ant java process has file handles open for all the  
> resolved 3rd party jars in /lib
>
> Also as a test, during the <sleep.../>, I tried deleting the files  
> in /lib using Windows explorer, but of course this didn't work either.
>
> Does anyone have a solution or suggestion for this issue? I don't  
> think Im the only one using windows and multiple targets withing the  
> same Ant "session"?
>
>
> Regards,
>
> Andreas Imner
>
>
>



      

Re: Why is Ivy locking my resolved dependencies until Ant finishes processing?

Posted by "Imner, Andreas" <An...@kgk.se>.
But before I started using Ivy for resolving the dependencies there  
were no file locking (see my reply that I wrote a short while ago).

Regards
Andreas



16 apr 2010 kl. 21.46 skrev "Maarten Coene" <ma...@yahoo.com>:

> My guess is that the VM is locking the jars in your lib directory  
> after step 2 (compilation or executing the junit tests).
> Did you fork the javac and junit tasks?
>
> Maarten
>
>
>
>
> ----- Original Message ----
> From: "Imner, Andreas" <An...@kgk.se>
> To: "ivy-user@ant.apache.org" <iv...@ant.apache.org>
> Sent: Fri, April 16, 2010 11:25:48 AM
> Subject: Why is Ivy locking my resolved dependencies until Ant  
> finishes processing?
>
> Hi
>
> I have a problem with Ivy that is blocking me from using it for  
> creating my daily builds. I am using Windows and this problem does  
> not appear on, for example, MacOS.
>
> My daily build -Ant target triggers (among others), the following  
> Ant targets
> 1. clean - cleaning /build and /lib
> 2. test  - resolving 3:rd party dependencies (conf="test") using Ivy  
> to /lib, compiling classes + test classes and executing the junit  
> tests
> 3. release - cleaning /build and /lib, resolving 3:rd party  
> dependencies (conf="run") using Ivy, compiling the classes and  
> assembling my webapp.
>
> When running these targets within the same Ant "session" (like "/>  
> ant clean test release") or when calling these targets from a single  
> target, using the "ant" -task the following happens in the beginning  
> of the "release" -target:
>
> C:\dev\trunk\04_Implementation\webshop-ng\build.xml:228: Unable to  
> delete file C:\dev\trunk\04_Implementation\webshop-ng\lib 
> \activation-1.1.1.jar
>
> But if I run the targets one by one, like
> ant clean
> ant test
> ant release
> ... the problems does not appear
>
> If I add a <sleep minutes="5"/> to my build.xml and the use  
> handle.exe, a sysinternals program for checking file handles, I can  
> see that the Ant java process has file handles open for all the  
> resolved 3rd party jars in /lib
>
> Also as a test, during the <sleep.../>, I tried deleting the files  
> in /lib using Windows explorer, but of course this didn't work either.
>
> Does anyone have a solution or suggestion for this issue? I don't  
> think Im the only one using windows and multiple targets withing the  
> same Ant "session"?
>
>
> Regards,
>
> Andreas Imner
>
>
>

Re: Why is Ivy locking my resolved dependencies until Ant finishes processing?

Posted by Maarten Coene <ma...@yahoo.com>.
My guess is that the VM is locking the jars in your lib directory after step 2 (compilation or executing the junit tests).
Did you fork the javac and junit tasks?

Maarten




----- Original Message ----
From: "Imner, Andreas" <An...@kgk.se>
To: "ivy-user@ant.apache.org" <iv...@ant.apache.org>
Sent: Fri, April 16, 2010 11:25:48 AM
Subject: Why is Ivy locking my resolved dependencies until Ant finishes processing?

Hi 

I have a problem with Ivy that is blocking me from using it for creating my daily builds. I am using Windows and this problem does not appear on, for example, MacOS.

My daily build -Ant target triggers (among others), the following Ant targets
1. clean - cleaning /build and /lib
2. test  - resolving 3:rd party dependencies (conf="test") using Ivy to /lib, compiling classes + test classes and executing the junit tests
3. release - cleaning /build and /lib, resolving 3:rd party dependencies (conf="run") using Ivy, compiling the classes and assembling my webapp.

When running these targets within the same Ant "session" (like "/> ant clean test release") or when calling these targets from a single target, using the "ant" -task the following happens in the beginning of the "release" -target:

C:\dev\trunk\04_Implementation\webshop-ng\build.xml:228: Unable to delete file C:\dev\trunk\04_Implementation\webshop-ng\lib\activation-1.1.1.jar

But if I run the targets one by one, like 
ant clean
ant test
ant release
... the problems does not appear

If I add a <sleep minutes="5"/> to my build.xml and the use handle.exe, a sysinternals program for checking file handles, I can see that the Ant java process has file handles open for all the resolved 3rd party jars in /lib

Also as a test, during the <sleep.../>, I tried deleting the files in /lib using Windows explorer, but of course this didn't work either.

Does anyone have a solution or suggestion for this issue? I don't think Im the only one using windows and multiple targets withing the same Ant "session"?


Regards,

Andreas Imner