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 Kent Larsson <ke...@gmail.com> on 2009/02/08 23:14:19 UTC
How do I get optional "indirect" dependencies?
Hi,
I've posted a related post about this, but since I now think I've got
a clue about what is going wrong I'm posting again with a more
specific problem description.
I need to get two dependencies which are set as
<optional>true</optional> so I'm asking, how do I do it?
If the only solution is looking in the POM-file and manually adding
dependencies I need which are set as optional, then I strongly suggest
Ivy to implement some support for them. The reason is that these
dependencies are only there as a side effect of some other dependency,
if I remove the dependency which has optional dependencies then I want
those gone as well.
My example is hibernate-core:
http://mirrors.ibiblio.org/pub/mirrors/maven2/org/hibernate/hibernate-core/3.3.1.GA/hibernate-core-3.3.1.GA.pom
<dependencies>
...
...
...
<!-- optional deps for bytecode providers until those are
finally properly scoped -->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.4.GA</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-cglib-repack</artifactId>
<version>2.1_3</version>
<optional>true</optional>
</dependency>
</dependencies>
Those two dependencies are really not optional at all. I don't
understand the comment and what needs to be scoped, but they are
needed for a functional Hibernate setup.
I really hope someone answers as I don't know where else to turn. As
users of Hibernate which are using Maven2 doesn't complain all over
the Internet about this I suspect it has something to do with Ivy.
This is how I currently get Hibernate core:
<dependency org="org.hibernate" name="hibernate-core" rev="3.3.1.GA"
conf="runtime->runtime"/>
Best regards and thank you for reading,
Kent Larsson
Re: How do I get optional "indirect" dependencies?
Posted by Maarten Coene <ma...@yahoo.com>.
To get the optional dependencies, you also need to resolve the "optional" configuration of hibernate-core:
<dependency org="org.hibernate" name="hibernate-core" rev="3.3.1.GA" conf="runtime->runtime,optional"/>
Maarten
----- Original Message ----
From: Kent Larsson <ke...@gmail.com>
To: ivy-user@ant.apache.org
Sent: Sunday, February 8, 2009 11:14:19 PM
Subject: How do I get optional "indirect" dependencies?
Hi,
I've posted a related post about this, but since I now think I've got
a clue about what is going wrong I'm posting again with a more
specific problem description.
I need to get two dependencies which are set as
<optional>true</optional> so I'm asking, how do I do it?
If the only solution is looking in the POM-file and manually adding
dependencies I need which are set as optional, then I strongly suggest
Ivy to implement some support for them. The reason is that these
dependencies are only there as a side effect of some other dependency,
if I remove the dependency which has optional dependencies then I want
those gone as well.
My example is hibernate-core:
http://mirrors.ibiblio.org/pub/mirrors/maven2/org/hibernate/hibernate-core/3.3.1.GA/hibernate-core-3.3.1.GA.pom
<dependencies>
...
...
...
<!-- optional deps for bytecode providers until those are
finally properly scoped -->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.4.GA</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-cglib-repack</artifactId>
<version>2.1_3</version>
<optional>true</optional>
</dependency>
</dependencies>
Those two dependencies are really not optional at all. I don't
understand the comment and what needs to be scoped, but they are
needed for a functional Hibernate setup.
I really hope someone answers as I don't know where else to turn. As
users of Hibernate which are using Maven2 doesn't complain all over
the Internet about this I suspect it has something to do with Ivy.
This is how I currently get Hibernate core:
<dependency org="org.hibernate" name="hibernate-core" rev="3.3.1.GA"
conf="runtime->runtime"/>
Best regards and thank you for reading,
Kent Larsson