ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles Scokart" <gscok...@gmail.com>
Subject RE: newbie: cant get local and shared repository to work correctly
Date Wed, 22 Nov 2006 07:47:53 GMT
I think you actually understand why cache exist.  The ivy notion of cache is
very similar to you shared repository.  It is owned by a user and it cache
libraries.

The only difference I see is that it will also 'cache' the result of any
resolve (including the artefacts that will be resolved in your local
repository).   Which might be a problem for you.  Is It?  If not (and
usually it is not), I think you should try to use the ivy cache as your
share repository.  Note that the cache doesn't need to be specified as a
resolver.  It is used implicitely, and will be filled automatically when you
resolve modules.   Howerver, if you want to publish to it, you need to use a
File resolver, or better, there is a non documented cache resolver.

The cache is also used to store some meta information that you usually not
have with an other repository.

However, your local repository is something very different.  You want a
repository per project (and per user).  You can implemented that with a
fileresolver as you did.

I'm just a little bit surprised by the chain order of your default resolver.
I would expect the rever order : first local, and if the dependency is not
found there, look in the shared, and only if it is not there look in the
public.



Gilles

> -----Original Message-----
> From: Robert Buck [mailto:rbuck@m-Qube.com] 
> Sent: Wednesday, November 22, 2006 3:57 AM
> To: ivy-user@incubator.apache.org
> Subject: newbie: cant get local and shared repository to work 
> correctly
> 
> I want to create a public, shared, and local repository. The 
> public repository is all set up and works.
>  
> Hi,
>  
> I have been successful in using Ivy so far. But I want to 
> configure multiple resolvers so that:
>  
> 1. the shared directory is located in the 
> ${user.home}/.ivy/shared directory
>  
> 2. the shared directory always retains copies of all 
> artifacts resolved so that each of the multiple user owned 
> sandboxes may share the third party libraries resolved from 
> the public repository
>  
> 3. the local repository is located within the sandbox so that 
> no other sandbox may share its state
>  
> 4. the local repository is where publications from sandbox 
> modules go as modules are built
>  
> So, the point to shared repository in this model is for one 
> individual to cache third party libraries, and to be able to 
> resolve them from any sandbox on demand. The shared 
> repository is not shared between users; users ought to be 
> able to sterilize their shared repository to deal with 
> potential corruption, and enable testing of publications 
> between multiple sandboxes without impacting other users.
>  
> I have tried writing several versions of the ivyconf files, 
> with no success. 
>  
> Could someone provide some insight to help me?
>  
> Am I doing something wrong?
>  
> Or do I have a misconception of how Ivy works?
>  
> On the topic of terminology, what is a cache in Ivy? Is it 
> distinct from the shared and local repositories? How so? What 
> is its purpose? I don't understand why it exists at all.
>  
> Of note, no shared directory is ever created when files are 
> resolved or published. Here is an excerpt of how my Ivy is configured:
>  
>  
> <?xml version="1.0"?>
> <ivyconf>
>   <conf defaultCache="${workspace.root}/ivy/cache"
> defaultResolver="default-resolver"/>
>   <property name="ivy.local.default.root"
> value="${workspace.root}/ivy/local" override="true"/>
>   <property name="ivy.local.default.ivy.pattern"
> value="[organisation]/[module]/[revision]/[artifact].[ext]"
> override="true"/>
>   <property name="ivy.local.default.artifact.pattern"
> value="[organisation]/[module]/[revision]/[type]s/[artifact]-[
revision].
> [ext]" override="true"/>
>   <property name="ivy.shared.default.root"
> value="${user.home}/.ivy/shared" override="true"/>
>   <property name="ivy.shared.default.ivy.pattern"
> value="[organisation]/[module]/[revision]/[artifact].[ext]"
> override="true"/>
>   <property name="ivy.shared.default.artifact.pattern"
> value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
> override="true"/>
>   <resolvers>
>     <filesystem name="local-resolver">
>       <ivy
> pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}"/>
>       <artifact
> pattern="${ivy.local.default.root}/${ivy.local.default.artifac
t.pattern}
> "/>
>     </filesystem>
>     <filesystem name="shared-resolver">
>       <ivy
> pattern="${ivy.shared.default.root}/${ivy.shared.default.ivy.p
attern}"/>
>       <artifact
> pattern="${ivy.shared.default.root}/${ivy.shared.default.artif
act.patter
> n}"/>
>     </filesystem>
>     <url name="public-resolver">
>       <ivy
> pattern="http://localhost:20080/ivyrep/[organisation]/[module]
> /ivy-[revi
> sion].xml"/>
>       <artifact
> pattern="http://localhost:20080/ivyrep/[organisation]/[module]
> /[revision
> ]/[artifact].[ext]"/>
>       <artifact
> pattern="http://localhost:20080/ivyrep/[organisation]/[module]
> /[revision
> ]/[artifact]-[revision].[ext]"/>
>     </url>
>     <chain name="default-resolver" returnFirst="true">
>       <resolver ref="public-resolver"/>
>       <resolver ref="shared-resolver"/>
>       <resolver ref="local-resolver"/>
>     </chain>
>   </resolvers>
> </ivyconf> 
> 


Mime
View raw message