http://maven.apache.org/guides/introduction/introduction-to-dependency-m
echanism.html
 
  

Dependency scope is used to limit the transitivity of a depedency, and
also to affect the classpath used for various build tasks.

There are 5 scopes available:

*       compile - this is the default scope, used if none is specified.
Compile dependencies are available in all classpaths.
*       provided - this is much like compile, but indicates you expect
the JDK or a container to provide it. It is only available on the
compilation classpath, and is not transitive.
*       runtime - this scope indicates that the dependency is not
required for compilation, but is for execution. It is in the runtime and
test classpaths, but not the compile classpath.
*       test - this scope indicates that the dependency is not required
for normal use of the application, and is only available for the test
compilation and execution phases.
*       system - this scope is similar to provided except that you have
to provide the JAR which contains it explicitly. The artifact is always
available and is not looked up in a repository.

Each of the scopes affects transitive dependencies in different ways, as
is demonstrated in the table below. If a dependency is set to the scope
in the left column, dependencies with the scope across the top row will
result in a dependency in the main project with the scope listed at the
intersection. If no scope is listed, it means the dependency will be
omitted.

 


________________________________

From: ir. ing. Jan Dockx [mailto:[EMAIL PROTECTED] 
Sent: Sunday, December 04, 2005 4:57 AM
To: Maven Users List
Subject: dependency scopes


I *really* don't fully grasp dependency scopes. Could somebody in the
know please have a look at
<http://docs.codehaus.org/display/MAVENUSER/Dependency+Scopes> and
correct some points?

Or at least, give a 1-sentence use case (example) for each of the
scopes?

Until now, I found the following scopes mentioned in docs:

* compile
* test
* runtime
* provided
* system

and the <optional /> tag


Met vriendelijke groeten,

Jan Dockx

PeopleWare NV - Head Office
Cdt.Weynsstraat 85 
B-2660 Hoboken 
Tel: +32 3 448.33.38 
Fax: +32 3 448.32.66 

PeopleWare NV - Branch Office Geel
Kleinhoefstraat 5
B-2440 Geel
Tel: +32 14 57.00.90
Fax: +32 14 58.13.25

http://www.peopleware.be/
http://www.mobileware.be/

Reply via email to