According to maven resolution of transitive scope ,
If A be our project which have a direct dependency on X whose scope is provided with respect to A.
Maven tells that any dependency (direct or transitive) of X with scope runtime will be resolved to scope provided
w.r.t A.
Let Y be a direct dependency of X with scope runtime
w.r.t to X.
A --> X(scope = provided) --> Y(scope = runtime)
Now, Y will resolved to provided scope
w.r.t to A.
Observation : Y will never be needed in runtime classpath
of A. It will be needed only in test classpath
of A. In fact , if you take Y as transitive dependency of X keeping its scope as runtime only, still it will never be used in A's runtime classpath
. It will be used only in test classpath
.
Question : So, should not we say -
If A be our project which have a direct dependency on X whose scope is provided with respect to A , then any dependency (direct or transitive) of X with scope runtime will be resolved to scope test
w.r.t A ?