Robert Munteanu
Robert Munteanu

Reputation: 68328

Sharing ivy configurations

I'm maintaining multiple projects backed by ivy configurations. Many configurations overlap, such as:

Is there a way to import these dependencies by referencing a shared configuration?


N.B. Please don't suggest Maven, as I know about it, but it is not (yet) an option for these particular projects.

Upvotes: 3

Views: 592

Answers (2)

Vladimir
Vladimir

Reputation: 6871

Reading your question, I would solve the problem by using svn:externals (if you're using Subversion) and not Ivy.

You place all your common configurations into a config Subversion project and simply use svn:externals to import it into other projects.

As example, you can take a look at my config project on Google Code:

Upvotes: 0

Rich Seller
Rich Seller

Reputation: 84088

Does include do what you need, or is the problem more complicated?

From the documentation:

<ivy-module version="1.0">
  <info organisation="myorg"
         module="mymodule"/>
  <configurations>
    <include file="path/to/included-configurations.xml"/>
    <conf name="conf3"/>
  </configurations>
  <dependencies>
    <dependency name="mymodule1" rev="1.0"/>
    <dependency name="mymodule2" rev="2.0" conf="conf2,conf3->*"/>
  </dependencies>
</ivy-module>

with included-configurations.xml like this:

<configurations defaultconfmapping="*->@">
  <conf name="conf1" visibility="public"/>
  <conf name="conf2" visibility="private"/>
</configurations>

Update: For dependencies, I'm not sure it is possible. I found a discussion on importing dependencies that indicates this is by design to avoid circular dependencies.

Perhaps you could write a script to process a referenced ivy file and inline the dependencies into your project?

Upvotes: 2

Related Questions