1

I have a huge dependency which exports a number of dependencies. I wish to restrict my retriev to couple of them. The pattern is [artifact]-[revision].[ext].

How do i specify this in ivy:retrieve task call

1
  • @Mark, thanks for this.. for example this dependency publishes a1.tar, a2.jar, ... an.zip I want to retrieve a1.tar, and an.zip thats it. I dont want to download everything because it takes a long time. Commented Dec 30, 2012 at 3:16

1 Answer 1

1

Configurations in ivy is the mechanism for controlling groups of dependencies within ivy.

Once these configurations have been setup in your ivy file it becomes simple to retrieve them within your ANT build as follows:

<ivy:retrieve pattern="lib/[artifact].[ext]" conf="my_custom_conf"/> 

Perhaps you could supply some more details of what you want to achieve and someone can demonstrate how to setup a configuration for this purpose. (I'd also recommend searching the Stackoverflow ivy tag, for other examples)

Update

If an ivy module publishes more than one artifact it's possible to restrict the dependency in your ivy file as follows:

ivy.xml

<configurations> .. <conf name="archives" description="Configuration containing only archive files"/> </configurations> <dependencies> .. <dependency org="acme" name="foo" rev="2.0" conf="archives->default"> <artifact name="a1" type="tar"/> <artifact name="an" type="zip"/> </dependency> </dependencies> 

Alternatively..

Look into the remote modules's ivy.xml. There may already be a configuration setup for these files, in which case it becomes a lot simpler (because it's been pre-setup)

<dependency org="acme" name="foo" rev="2.0" conf="archives->remotearchives"/> 

The "conf" part of the dependency is mapping the remote configuration onto your local one.

Sign up to request clarification or add additional context in comments.

1 Comment

To get above ivy.xml to work as an independent file, I wrapped the content inside ivy:module. <ivy-module version="1.0"> <info organisation="your-org" module="your-module"/> <configurations> ... </ivy-module> And referred to it as <ivy:retrieve file="ivy" pattern="${ivy.lib.dir}/[conf]/[artifact].[ext]"/> in your build.xml file. Hope this helps someone.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.