Home > Net >  How Maven Provided scope interacts with Test scope
How Maven Provided scope interacts with Test scope

Time:03-04

My project has a dependency (Provided Scope), then If I run my project under Test Scope for unit tests, then how does Maven find this dependency it needs during unit testing? Would Maven just use the one in local maven repository (if exists)? Thank you.

CodePudding user response:

From official documentation:

A dependency with this scope is added to the classpath used for compilation and test, but not the runtime classpath.

So yes, during test phase, the dependency will need to be available (or will be downloaded) in your local Maven repo.

  • Related