Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
A provided scope dependency can also be thought of as "compile-only".
Project A requires Sybase JConnect on the runtime classpath. Project A declares a "provided" dependency on Sybase JConnect.
Project B depends upon Project A. Project B declares a "compile" dependency on Project A.
Project C depends upon Project B. Project C declares a "compile" dependency on Project B.
C | - compile dependency B | - compile dependency A | - provided dependency Sybase JConnect
So, does Project C transitively depend on Sybase JConnect. Yes, of course! The "provided" dependency needs to be transitive.
Ultimately, when Project C gets deployed, Sybase JConnect needs to be somewhere on the runtime classpath in order for the application to function. It's valid for Project C to assume that Sybase JConnect is available and use JDBC all over the Project C code. Project C is safe to do this because it can happily deduce that Sybase JConnect will be there in the runtime environment because Project A NEEDS IT.
I've got Use Cases all over my aggregated build which make it absolutely critical and common sense that provided scope dependencies are transitive. For the (very rare) odd case where you don't want to inherit provided dependencies, you can <exclude/> them.
Attachments
Attachments
Issue Links
- causes
-
MENFORCER-385 Enforce that transitive provided dependencies are contained in the runtime Maven classpath
- Closed
- is duplicated by
-
MNG-4746 A provided scoped transitive dependency of a provided scoped direct dependency will be omitted.
- Closed
-
MNG-1978 "Provided" scope transitive dependencies required + exclude dependencies for runtime scope only
- Closed
-
MNG-5048 Optionally include "provided" transitive dependencies on classpath
- Closed
-
MNG-2611 test scope should inherit provided scope
- Closed
- is related to
-
MNG-2589 Inherit transitive dependencies with runtime scope
- Closed
- relates to
-
MNG-3890 Transitive dependencies override explicitly set scope.
- Closed
-
MNG-2317 Provided scope dependencies are based in target app server, current approach doesn't work very well
- Closed