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 Pa...@nokia.com on 2008/03/18 23:18:49 UTC

Creating a custom Ivy resolver

Hi,
 
I'm interested in using Ivy to create a report of the resolved
artifacts, but not to actually download the artifacts (in some cases
they will be very large, in others they simply need to be verified but
used in-place - either way that will be handled separately).
 
Some of the repository locations are custom in-house tools, etc that
would require custom resolvers. What are the basic methods that need
supporting to implement a resolver that simply outputs a list of
identified artifacts?
 
Also sometimes there would not be any Ivy files to parse. How would it
be best to get the list of artifacts by parsing the content of a
directory?
 
thanks

paul 

 

Re: Creating a custom Ivy resolver

Posted by Xavier Hanin <xa...@gmail.com>.
On Tue, Mar 18, 2008 at 11:18 PM, <Pa...@nokia.com> wrote:

> Hi,
>
> I'm interested in using Ivy to create a report of the resolved
> artifacts, but not to actually download the artifacts (in some cases
> they will be very large, in others they simply need to be verified but
> used in-place - either way that will be handled separately).

You can do this via Ivy API, there is an option to ask to resolve without
downloading artifacts.

>
>
> Some of the repository locations are custom in-house tools, etc that
> would require custom resolvers. What are the basic methods that need
> supporting to implement a resolver that simply outputs a list of
> identified artifacts?

A resolver can't simply output a list of artifacts. You have to implement
the full interface. The easiest way is to take inspiration from other
resolvers. Usually URL Resolver or File system resolvers are a good starting
point. Indeed they actually delegate the specific work to a Repository,
which is is much more simple to implement than a DependencyResolver.

>
>
> Also sometimes there would not be any Ivy files to parse. How would it
> be best to get the list of artifacts by parsing the content of a
> directory?

It depends how your artifacts are stored. If you implement your own resolver
you can generate metadata (ModuleDescriptor) from whatever you want, so you
don't actually need to have a file, it can be a directory listing. Have a
look at DefaultModuleDescriptor (the implementation of ModuleDescriptor),
it's not really documented but most things should be pretty obvious,
especially if you look at how it's build by XmlModuleDescriptorParser which
is responsible for Ivy files parsing.

If you have more precise questions with more details on your environment
maybe we could help you further.

Xavier

>
>
> thanks
>
> paul
>
>
>


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