ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Hanin" <xavier.ha...@gmail.com>
Subject Re: Client side created module descriptors for dependencies
Date Wed, 16 Jan 2008 14:43:09 GMT
On Jan 16, 2008 3:12 PM, Hans Dockter <mail@dockter.biz> wrote:

> I have the following use case.
>
> For the build tool I'm developing (which uses Ivy via its API) I want
> to offer the following functionality:
>
> A user has three options to add dependencies:
>
> 1 - Via a module found in a repository
> 2 - A single jar
> 3 - An artificial module create on the client side.
>
> 1.) and 2.) is easy to achieve.
>
> For 3.) I'm not sure how to achieve this.
>
> An example:
>
> In the build script the user declares something like:
>
> deps.compile "org.springramework:spring:2.5", "commons-io:commons-io:
> 3.1:jar", [mod: 'org.hibernate:hibernate:3.0.5', deps: 'log4j:log4j:
> 1.2.14:jar', 'ehcache:ehcache:1.2.3:jar', ....]
>
> Under the hood a module descriptor with the configuration compile is
> created. We add two dependency descriptors for spring and commons-io.
> We can now easily do a Ivy.resolve and things work perfectly for
> spring and commons-io. But for the hibernate example things are
> different. I want to avoid using metadata of a repository but still
> be able to use the transitive dependency handling of Ivy (for compile
> with transitive = false, for reports, ....).  I want to create my own
> module descriptor for hibernate, which is easy to do. But how to
> integrate this module descriptor in the Ivy resolve workflow?
>
> Workflow (roughly):
>
> 1.) Find module descriptor in repository.
> 2.) Analyse descriptor and download artifacts.
>
> I want to inject my hibernate module descriptor into 2.). It should
> be treated the same as the ones found in a repository. Is there a way
> to achieve this?

Since you are calling Ivy from API, I guess you can change the settings on
the fly and surround the actual resolvers in a returnFirst chain, with your
own resolver put first in this chain. Then in your custom resolver you check
if a custom metadata is provided, in which case you return it so that Ivy
won't use the actual resolver.

Xavier

>
>
> Deploying such a project (with client side created module descriptors
> for dependencies)  to a repository is another story (with some loss
> of information this would be still possible I think). And many
> projects are not libraries and thus have no need to be put in a
> repository.
>
> - Hans
>
>
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message