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 Ernest Pasour <Er...@sas.com> on 2008/04/07 21:05:01 UTC

retrieving the modules and organizations via the API

I'm using 2.0B1

I'm trying to use an Ivy object to determine the modules in my current ivy repo chain.  So I do something like the following:


Ivy ivy = Ivy.newInstance();
OrganisationEntry[] orgEntries=ivy.listOrganisationEntries();
for (int i=0;i<orgEntries.length;i++)
{
        ModuleEntry[] modules=ivy.listModules(orgEntries[i]);
}

However, the list of OrganisationEntry objects I get back does not match the organizations that are expected in the ivy.xml file:
<dependency name="JavaMail" rev="1.4.0" org="TPJ" conf="runtime,compile"/>

In this case, I don't get back any "TPJ" organization at all.  I *do* get all the modules back, but with duplicates and some with bogus organizations.

Also, if I use the Ivy api to do a resolve on a ModuleRevisionId constructed from the module name and [bogus] organization, it fails.

So, my questions are:
1. is this a bug?
2. is there a way for me to query the organizations/modules that will let me feed them back into the ivy.xml file/resolve call correctly.
3. I still need to be able to query each module for the available revisions, which seems to work correctly at the moment, despite the conflicting data.


Thanks,
Ernest


Re: retrieving the modules and organizations via the API

Posted by Xavier Hanin <xa...@gmail.com>.
On Mon, Apr 7, 2008 at 9:05 PM, Ernest Pasour <Er...@sas.com> wrote:

> I'm using 2.0B1
>
> I'm trying to use an Ivy object to determine the modules in my current ivy
> repo chain.  So I do something like the following:
>
>
> Ivy ivy = Ivy.newInstance();
> OrganisationEntry[] orgEntries=ivy.listOrganisationEntries();
> for (int i=0;i<orgEntries.length;i++)
> {
>        ModuleEntry[] modules=ivy.listModules(orgEntries[i]);
> }
>
> However, the list of OrganisationEntry objects I get back does not match
> the organizations that are expected in the ivy.xml file:
> <dependency name="JavaMail" rev="1.4.0" org="TPJ" conf="runtime,compile"/>
>
> In this case, I don't get back any "TPJ" organization at all.  I *do* get
> all the modules back, but with duplicates and some with bogus organizations.
>
> Also, if I use the Ivy api to do a resolve on a ModuleRevisionId
> constructed from the module name and [bogus] organization, it fails.
>
> So, my questions are:
> 1. is this a bug?
> 2. is there a way for me to query the organizations/modules that will let
> me feed them back into the ivy.xml file/resolve call correctly.
> 3. I still need to be able to query each module for the available
> revisions, which seems to work correctly at the moment, despite the
> conflicting data.


According to your code you don't seem to be calling configure on your Ivy
instance. It's very important for Ivy to work properly to be configured with
your settings. If it still fails, maybe it's because you don't have an
organization token in your pattern. In this case Ivy has no way to know the
organizations without actually parsing all metadata files in your repo,
which is possible only with the RepositoryManagementEngine, which as you can
expect doesn't perform very well.

Xavier

>
>
>
> Thanks,
> Ernest
>
>


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