The reason for this difference is because if B extends a class from A, and C uses the class from B, A is required at compile time.
Otherwise, I'd agree. - Brett On 10/7/05, John Fallows <[EMAIL PROTECTED]> wrote: > On 10/6/05, Brett Porter <[EMAIL PROTECTED]> wrote: > > Sorry, I'm missing something. Why isn't B depending on A with "runtime" > > scope? > > B depends on A with "compile" scope because it directly uses classes > from A during compilation, not just at runtime. > > This gives the following scenario. > C --(compile)--> B --(compile)--> A > > But, I am concerned that this implies.. > C --(compile)--> B > C --(compile)--> A > > when all that is necessary is.. > C --(compile)--> B > C --(runtime)--> A > > so that C can successfully compile and so that the classes in both A > and B can be loaded and resolved during unit testing of C. > > Kind Regards, > John Fallows > > > On 10/6/05, John Fallows <[EMAIL PROTECTED]> wrote: > > > Suppose I have 3 Maven2 projects, A, B and C. > > > > > > A is self-contained. > > > B depends on A for-implementation-only. > > > C depends on B. > > > > > > My understanding of dependency scopes is that if C depends on B at > > > "compile" scope, then all of B's "compile" scope dependencies will > > > also become transitive "compile" scope dependencies of C. > > > > > > How do I prevent the classes in A from being visible during > > > compilation of C? Is this another usecase for "provided" scope? Or > > > does marking the A dependency as "provided" scope may have other > > > implications for project B? > > > > > > I am concerned about the potential to introduce an accidental direct > > > dependency from A to C. > > > > > > Ideally, I'd like project B to control the full set of compile > > > dependencies that are valid exports as transitive dependencies. > > > > > > Although I don't want to expose B's dependencies during compilation of > > > C, some of those dependencies will be necessary at runtime or during > > > unit test execution of C. > > > > > > Perhaps we could specify "compile" scope for C's dependency on project > > > B itself, but "test" scope (say) for all of project B's dependencies? > > > > > > Kind Regards, > > > John Fallows. > > > > > > --------------------------------------------------------------------- > > > 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]
