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

4 comments
Comment actions Permalink

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).

0
Comment actions Permalink

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

0
Comment actions Permalink

Yes, that is correct.

0
Comment actions Permalink

Thanks Serge!

Have a good weekend.

regards,
Lin

0

Please sign in to leave a comment.