On 17/01/2008, Simon Kitching <[EMAIL PROTECTED]> wrote:
> Suppose your project depends on class Foo from project p1 (and so declares a 
> compile-scope dependency on p1).
>
> But class Foo extends class Base from project p2 (and so p1 has a 
> compile-scope dependency on p2). So project p2 (even though it is a 
> transitive dependency) is needed at compile time for your code.

  I have a related question / remark : Imagine a Maven module that is
used as a library. This library has classes that are part of a public
interface, and classes the are the actual implementation. The
implementation can depend on other artifacts to compile, but those
artifacts should not be needed to compile a project depending on our
library.

  Of course, the right thing to do is to split the library in an "api
module" and an "implementation module". But imagine that you have
legacy code that didnt follow this separation (everybody knows that
bad design never happens in real life project ;-). Would it be
possible to declare a compile time dependency that will not be
transitive ? Or that will only be a runtime dependency transitively ?

  I'd like to know what you think about this kind of problems ...

> P2's runtime dependencies will not be needed, so I suppose those are not 
> fetched.
>
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
>
> Cheers, Simon
>
> ---- Nick Stolwijk <[EMAIL PROTECTED]> schrieb:
> > Then I was wrong there. I thought when maven needs a dependency for
> > compilation, it wouldn't need the transitive dependencies.
> >
> > With regards,
> >
> > Nick Stolwijk
> >
> > Simon Kitching wrote:
> > > Nick: for maven2, if a pom declares a dependency on something that itself 
> > > has non-optional dependencies, then they should get *immediately* 
> > > downloaded.
> > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Jabber : [EMAIL PROTECTED]
Skype : Guillaume.Lederrey
Projects :
* http://rwanda.wordpress.com/
* http://rwandatech.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to