0

How exactly translate IVY to Maven configurations through the task makepom ?

1.) For example IVY "default" Configuration has no equivalent in its Maven Scope :

      I understand ... You could put that in a generation task, makempom would do the following equivalence :

<ivy:makepom ..... conf=”default,compile,runtime”>

   <mapping conf="default" scope="compile"/>
   <mapping conf="compile " scope="compile"/>
   <mapping conf="runtime" scope="runtime"/>
</ivy>

2.) But what happens when you have dynamic configurations in IVY, for example, with this IVY configuration, for example "myConf" :

   <configurations defaultconf="default->default">
    <conf name="default" description="shortcut to runtime and master dependencies"/>
    <conf name="compile" description="Used ONLY at compile time" />
    <conf name="myConf" description="Not required at compile time BUT required for execution and so deployed to a server"/>

</configurations>

What possibilities exist in this case of translation from IVY to Mave ??? Especially if un have "n" different configurations  , does not seem very practical to have to configurate "n" confs into the makepom task with his corresponding scope. Also I note that if you do not put anything in the task makepom, the generared pon has no scope and always is put to optional :

<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-lang3</artifactId>
   <version>3.3</version>
   <optional>true</optional>
</dependency>

This maven code is resulting from an ivy file where the commons-lang3 libs is put on the "default" setting :

<dependency org="org.apache.commons" name="commons-lang3" rev="3.3"  conf="default->default"/>
Azimuts
  • 1,212
  • 4
  • 16
  • 35

1 Answers1

0

I answer myself.

It's only possible to use the Maven Scopes. If there is any configurantion in ivy that it has not his equivalent scope on Maven you have to define the equivalence to Maven scope into the makepom task,

For example:

Azimuts
  • 1,212
  • 4
  • 16
  • 35
  • 1
    Correct. I would also look at the inverse relationship. How does ivy interpret remote Maven POM files and scopes. See: http://stackoverflow.com/questions/7104364/how-are-maven-scopes-mapped-to-ivy-configurations-by-ivy/7116577#7116577 Maven is less flexible in this regard, compared to ivy configurations. It's best to understand these restrictions and then adapt your usage to suit them. – Mark O'Connor Oct 05 '14 at 15:32