maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@scalaris.com>
Subject Re: Scope question
Date Tue, 05 Nov 2013 10:28:55 GMT
Hi Guillaume,

Guillaume CHAUVET wrote:

> Hello,
> 
> I wondering if it is possible to change the scope of a dependency
> depending on the position in the tree of dependencies ? Here is a small
> example: An artifact "A" with a dependence on a "z" artifact defined with
> "compile" scope. If I use artifact "A" in a project "B", I would like the
> dependency scope of "z" becomes "runtime", in order to prevent the user to
> explicitly call classes from artifact "z ".
> 
> Do you think it is possible to have this kind of behaviour ?

Use a dependencyManagement section to define version and scope of runtime 
for z. If you share the section in a parent for A and B, then you can simply 
redeclare the scope in A to compile.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message