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]

Reply via email to