On 5/4/07, todd lee <[EMAIL PROTECTED]> wrote:
Gilles Scokart wrote:
>
>
> So I think the 2 repository with chained resolver is the right approach to
> take, because it will allow you to more easily evolve, and more easily
> migrate one or the other repository without having to change his layout.
>
>
Thanks for the input Gilles, so given that this is something that we're in
the process of implementing right now, I wonder if someone would be willing
to share the details of their experience with implementing this? If we can
learn from someone's wins/losses we would certainly be grateful!
Beyond the basics of setting up the hardcoded path segments for resolvers
(all of our stuff is local/filesystem based) in the ivysettings file ie -
<chain name="local-repository">
<filesystem name="local-releases">
<ivy
pattern="${ivy.repo.dir}/release/[organization]/[module]/[revision]/ivy.xml"/>
<artifact
pattern="${ivy.repo.dir}/release/[organization]/[module]/[revision]/[artifact].[ext]"/>
</filesystem>
<filesystem name="local-integrations">
<ivy
pattern="${ivy.repo.dir}/integration/[organization]/[module]/[revision]/ivy.xml"/>
<artifact
pattern="${ivy.repo.dir}/integration/[organization]/[module]/[revision]/[artifact].[ext]"/>
</filesystem>
</chain>
How are people specifying their resolve strategy to ensure that the right
resolver/repository is used?
It depends on what you mean by the 'right' repository. Usually the
main special point is if you use a local repository, which must take
precedence over any other repository, to be sure what you publish here
will be picked up (useful when a developer is working on two modules
or more). This can easily be accomplished using a chain with
returnFirst="true". Then in regular sistuations if you ask a
latest.integration version both a release and an integration
repository are 'right', so a regular chain between the two is ok. If
you want some module to depend on the latest release, things get
slightly more complicated. You can use latest.release, this works
fine, expect that it needs to load your modules metadata to know if a
module is a release or not. In your case this shouldn't be an issue if
all your repositories are filesystem based (unless you use a slow
shared filesystem). If it is a problem you can also switch between
different settings (one with and one without your integration repo)
depending on your needs. But this applies to the whole dependency
resolution, and thus does not answer to finer grain needs (like
latest.release). A neat solution which require some work would be add
a filter to a dependency resolver, to use it only when latest.release
is asked, for instance. Not too difficult to implement, but require
some Java work (could be contribute back to the community if
implemented with some flexibility).
Xavier
It may seem like a basic question, but it seems
pretty critical to being able to properly setup and maintain a repository as
Gilles described earlier. I'm assuming that the best way is to conditionally
switch on ${ivy.status} and set ${ivy.resolver} accordingly. Is there
anything 'under the hood' that we should be aware of that might help/hinder
us??
Thanks
Todd
--
View this message in context:
http://www.nabble.com/best-repository-layout--%28opinions-solicited%29-tf3682010.html#a10322325
Sent from the ivy-user mailing list archive at Nabble.com.
--
Learn Ivy at ApacheCon: http://www.eu.apachecon.com/
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/