You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gilles Scokart <gs...@hotmail.com> on 2006/03/23 13:40:59 UTC

[M2] Does runtime dependencies really exist ?


In Maven 2, compile dependencies are transitive.  It means that the
libraries called from the library I use are included in the compile path. 
And so transitively...  At the end, if all libraries are build and
distributed with maven, all the libraries I need at runtime will
transitivelly be in the compile path!  Am I wrong? 

I understand the reasons for which 'compile' stay transitively 'compile':
It's easier when you use inheritance accross modules.  However, I regret the
choice made in maven.   The alternative was to say = "Well, if you use a
class of a module B which extends a class of module C... You are actually
using the interface exposed by C, and you should place C as a compile
depency."  

I mean, It's only if the dependencies of my dependencies are included in
runtime by default that the runtime dependencies make sense.

One of the bad consequence of this choice has already been presented in this
thread : http://www.nabble.com/forum/ViewPost.jtp?post=1045013

To sumarize, the question was "When I write a module B for which I use a
module C, how can I prevent the module A to use directly the module C ?". 
The answer was not given, but it was : "You must say it in the pom of the
module A".  The author wanted to put that in the pom of the module B because
A has no reason to know that B use C.

An other problem I see with the choice that was made is "How did I know
precisely which module is really used directly (I mean at compile time) by
my module?".

Now, ok this choice has been made and can not be changed.  But maybe things
could be adapted.  We can imagine to add an XML tag to the dependency block
to say how to export a compile dependency.  By default it can stay
"compile", but with the possibility to say "runtime".

How do you feel it?
--
View this message in context: http://www.nabble.com/-M2-Does-runtime-dependencies-really-exist--t1330012.html#a3551082
Sent from the Maven - Users forum at Nabble.com.


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