Talking about Maven, I know that:
- a compile dependency is not included in the final outcome when packaging is jar
- on the other hand, it is being included if packaging is war
- a provided dependency is never included in the final outcome neither with jar nor with war packaging
For example, in the case of a compile scoped dependency in a jar packaging, at compile time Maven will simply fetch the dependency from local/remote repositories, without including such dependency in the final artifact.
If all this is correct, my questions are:
1) Who is then usually providing a compile scoped dependency at runtime for a jar artifact?
2) What is the difference between a provided dependency in a jar and a war packaging then?