I came across an issue I raised on StackOverflow: http://stackoverflow.com/questions/7373105/noclassdeffounderror-org-junit-afterclass-during-annotation-processing/7375380#7375380

I have a library B having a compile dependency (i.e. scope) on A.
I have a library C having a test dependency (i.e. scope) on B.

When I compile C, it includes B, but not A. And since C calls B calls A, it crashes at runtime.

Apparently, this is how it should work according to the dependency scope (http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope).

Yet, why should users of C explicitly declare a compile dependency to A, when we know at compile time that A will be required? Shouldn't the transitivity rule be that if you have such a transitive relationship, A should always be compile dependency of A? Or is there something I am missing?

The problem is that the runtime crash is really late to be notified about this issue. It does not fit with the maven philosophy.

Thanks,

JVerstry

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to