---- Guillaume Lederrey <[EMAIL PROTECTED]> schrieb:
> 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 ?

What you could possibly do is create a profile that you would use for 
compiling. In this profile, add the problem dependencies with scope of 
"compile". But in the main part, add the problem dependencies with scope of 
"runtime", so that projects which just *use* your code (via its pom) see the 
lib as just a runtime dependency, not a compiletime one.

I'm not sure if it's possible to have the same dependency twice (which will 
happen when the profile is active) but it might be worth trying..

Regards, Simon

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

Reply via email to