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 Garima Bathla <ga...@gmail.com> on 2009/03/27 21:10:05 UTC
Retrieve the list of confs
My requirement is to programmaticlly retrieve the list of confs for a given
module and revision.
e.g. Given a Module name = [XXX] revision=[1.0.0] and ivysettings.xml
already in place; what API I can use to retrieve the list of confs available
for this module, in any of the repositories those are listed in
ivysettings.xml.
Also please note that I need a Java API; ( Also at this point I am using
Apache Ivy standalone, not invoking Ivy via ant tasks).
Thanks,
Garima.
Re: Retrieve the list of confs
Posted by Maarten Coene <ma...@yahoo.com>.
You could take a look at the implementation of the ivy:info ant task, which can retrieve the list of configurations from a module:
https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/java/org/apache/ivy/ant/IvyInfo.java
Maarten
----- Original Message ----
From: Garima Bathla <ga...@gmail.com>
To: ivy-user@ant.apache.org
Sent: Friday, March 27, 2009 9:10:05 PM
Subject: Retrieve the list of confs
My requirement is to programmaticlly retrieve the list of confs for a given
module and revision.
e.g. Given a Module name = [XXX] revision=[1.0.0] and ivysettings.xml
already in place; what API I can use to retrieve the list of confs available
for this module, in any of the repositories those are listed in
ivysettings.xml.
Also please note that I need a Java API; ( Also at this point I am using
Apache Ivy standalone, not invoking Ivy via ant tasks).
Thanks,
Garima.
Re: Retrieve the list of confs
Posted by Garima Bathla <ga...@gmail.com>.
OK , the only way I figured it out was by digging the ivy code - :-) . Since
Ivy can be used as standalone tool - having Ivy JavaDoc around will be handy
( just a suggestion).
For your pleasure the solution is below:
Ivy ivy = Ivy.newInstance();
URL ivySettinsURL = new URL("path/to/ivy/settings/file); //
You can also use ivy.configure(File IvySettingsFile) method.
ivy.configure(ivySettinsURL);
ivy.pushContext();
ResolvedModuleRevision rmd =
ivy.findModule(ModuleRevisionId.newInstance(
"orgName", "ModuleName", "Revision"));
Configuration[] con = rmd.getDescriptor().getConfigurations();
String[] confs2 = rmd.getDescriptor().getConfigurationsNames();
Regards,
Garima.
On Fri, Mar 27, 2009 at 1:10 PM, Garima Bathla <ga...@gmail.com>wrote:
> My requirement is to programmaticlly retrieve the list of confs for a given
> module and revision.
>
> e.g. Given a Module name = [XXX] revision=[1.0.0] and ivysettings.xml
> already in place; what API I can use to retrieve the list of confs available
> for this module, in any of the repositories those are listed in
> ivysettings.xml.
>
> Also please note that I need a Java API; ( Also at this point I am using
> Apache Ivy standalone, not invoking Ivy via ant tasks).
>
> Thanks,
> Garima.
>
>