ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Chaney <a...@writingshow.com>
Subject Re: Deleting previous JARs/revisions - avoiding duplicate JARs
Date Tue, 28 Apr 2009 16:04:02 GMT
Hi Alex
> Hi all,
>
> I've recently started using Ivy for a small 'core' package where I work
> (that's your 'noob' flag). I really like what I've seen so far, but I'm
> stumped on one thing: removal of previous JARs (i.e. revisions) when a newer
> revision is available. For example, say I have my-lib.1.1.jar and I change
> my ivy.xml to require 1.2, I would like the my-lib.1.1.jar to be
> removed/deleted.
>
> I *think* the conflict element in my ivy.xml (ref:
> http://ant.apache.org/ivy/history/trunk/ivyfile/conflict.html) should do
> this for me, but the documentation is quite confusing and there are no
> examples. Furthermore the default conflict manager is latest-revision which
> is what I'd assume would be used, so I doubt there's any explicit
> configuration needed. Regardless, my ivy:retrieve does not remove it and I'm
> left with duplicate JARs in my lib folder - something I really want to
> avoid.
>
> Can anyone shed some light on what I'm missing please?
>
>   
I wouldn't claim to be an Ivy expert, but I have had a similar problem.

You don't say how your ivy:retrieve is configured. Ivy is fundamentally 
a two step process:

1. Resolve the *project* dependencies required (which puts them in the 
ivy cache)
2. Retrieve the artifacts to a location you specify.

You can bypass step2 by configuring your classpath to include the 
ivy:cachepath output for compiles etc, but you normally need to retrieve 
them when building and deploying your own artifacts.

I suspect that you using ivy:retrieve to place your depedency artifacts 
in a local location (such as a 'lib' folder) and that what is happening 
is that the 'old' versions are still there when you retrieve a later 
version. I had a similar problem assembling jars for a war file, and 
found that what I need to do was to simply clear the target folder using 
an Ant 'delete' task, configured appropriately of course.

Or, I may have completely misunderstood what it is that you doing, in 
which case I apologize!

Regards

Alan Chaney


> Many thanks,
>
>   


Mime
View raw message