for provided scope of a Maven dependencies
Hello everyone,
If I add a provided scope dependency for a Maven Java project in IntelliJ, wondering where the dependency jar should exist? The formal defintion of "provided" means it is JDK or container provded, does it mean Maven will not download from repository as "compile" scope jar? Thanks in advance.
regards,
Lin
请先登录再写评论。
This answer explains it well: http://stackoverflow.com/a/6647178/104891 .
Provided dependency will be downloaded like any other dependency. The jar will be stored in Maven .m2 folder on your system. It will be used for compilation and running tests, but not at runtime of your application where it will be satisfied externally (JDK, application server container, etc).
Thanks Serge,
The differences between compile scope is only at run time, for compile scope jars, we (applicaton developer) need to provide jar at runtime without assumption container or JDK will provide it? Thanks.
regards,
Lin
Yes, that is correct.
Thanks Serge!
Have a good weekend.
regards,
Lin