You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Antonio Parolini <An...@hcuge.ch> on 2007/10/25 11:50:57 UTC

Transitivity on/off

Hello,

I found this note on the maven wiki:
<snip>
Attachments and Transitive Resolution
We also need a way to distinguish the dependencies that apply when resolved
transitively via an attached artifact, rather than the main one. For
example, while the server-side component of an EJB may need several
dependencies, the ejb-client aspect might only need one or two of those,
just enough to fulfill the needs of the EJB interfaces, and give the client
the ability to work with the data. However, when a dependency of type
ejb-client is declared in a project, the entire dependency set is resolved
transitively.
</snip>

I totally agree with this. Transitivity is great, but sometime it is just a
pain... especially with ejb-clients..

 Is there a plan to adress this issue on the futur release of maven ?  Like
to add a flag to turn on/off transitivity at dependency declaration time:

<dependency>
<artifactId>..</artifactId>
<groupId>..</groupId>
<version>1.0</version>
<transitivity>false</transitivity>
</dependency>

This would be so great.... wound't it ?

Cheers,

-toni

-- 
View this message in context: http://www.nabble.com/Transitivity-on-off-tf4689655s177.html#a13403328
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Transitivity on/off

Posted by Graham Leggett <mi...@sharp.fm>.
On Thu, October 25, 2007 11:50 am, Antonio Parolini wrote:

> I totally agree with this. Transitivity is great, but sometime it is just
> a
> pain... especially with ejb-clients..
>
>  Is there a plan to adress this issue on the futur release of maven ?
> Like
> to add a flag to turn on/off transitivity at dependency declaration time:
>
> <dependency>
> <artifactId>..</artifactId>
> <groupId>..</groupId>
> <version>1.0</version>
> <transitivity>false</transitivity>
> </dependency>
>
> This would be so great.... wound't it ?

Unfortunately not - with transitivity turned off, you now move from an EJB
client will too many dependencies to an EJB implementation with too few
dependencies, and code that doesn't build. :(

Using EJB3, we have approached this by declaring the EJB client interface
in its own project, and the EJB implementation in a second project. Being
different projects, they can export different sets of dependencies. (It
also solves the problem of people arbitrarily changing the interface)

To get this to work in JBoss, we needed to make sure that the EJB client
interface was also declared as an EJB in itself. The two EJBs (EJB-client
and EJB) where then deployed into the ear file, and it works great.

Regards,
Graham
--



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org