1
votes

please does anybody know the answer to the following, rather obvious, question regarding the "matrix of scopes" in the official maven docs:

https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope

The footnote explains why the cell indexed [compile,compile] again contains the value "compile".

In my opinion, the VERY SAME ARGUMENT implies the following:

  1. Cells [compile,provided] and [provided,provided] both should contain "provided".

  2. Cell [test,provided] should contain "test".

So why do all of these cells contain "-" ?!? It doesn't make sense to me...

Many thanks in advance for all kind of useful suggestions!

1

1 Answers

0
votes

provided means that the depedency is provided by the container, which implies that the usage of this scope depends on the container at hand.

Therefore, this scope should be set at the level of the "deployable unit" (war, ear, standalone jar), not somewhere deep down in the transitive dependency tree. Hence it is not useful to have transitivity for provided dependencies.

Instead you can overwrite the scope with dependencyManagement at the highest level to ensure that you mark those dependencies as provided that are provided by your container.