I think I may need a concrete example to make sure I understand the
issue properly. However, in my opinion dependency management
specifications should be used for anything not explicitly specified.
For example,
<project>
<arifactId>parent</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<artifactId>foo</artifactId>
<version>1.0.0</version>
<scope>runtime</scope>
<dependency>
<dependencies>
</dependencyManagement>
</project>
<project>
<parent>
<artifactId>parent</artifactId>
</parent>
<artifactId>child</artifactId>
<dependency>
<artifactId>foo</artifactId>
</dependency>
</project>
results in version 1.0.0 with scope runtime.
<project>
<parent>
<artifactId>parent</artifactId>
</parent>
<artifactId>child</artifactId>
<dependency>
<artifactId>foo</artifactId>
<scope>compile</scope>
</dependency>
</project>
results in version 1.0.0 with scope compile.
<project>
<artifactId>bar</artifactId>
<dependency>
<artifactId>foo</artifactId>
<scope>compile</scope>
</dependency>
</project>
<project>
<parent>
<artifactId>parent</artifactId>
</parent>
<artifactId>child</artifactId>
<dependency>
<artifactId>bar</artifactId>
<scope>compile</scope>
</dependency>
</project>
results in foo being version 1.0.0 with scope compile (since bar is a
transitive dependency).
Ralph
On Jan 9, 2009, at 10:06 AM, Shane Isbell wrote:
I've run into an issue where the current behavior of building a
project
model in Maven 2.0.x seems wrong. In the case of inheritance of
dependency
scope, there is a default value of "compile". This default will
override the
parent scope. This part is correct. But if the dependency scope is not
specified, the default value CAN be overridden by the dependency
management
section of the pom. So in one case, the default value can't be
overridden,
but in the other case it can.
I'm thinking that both dependencyManagement and inheritance should
function
the same in Maven 3. If the developer doesn't specify a value, the
default
value should be applied to the model (prior to any inheritance or
management). This would mean that dependencyManagement dependency
container
will not be joined with a dependency container, unless the scope
specified
in one matched the default scope in the other. Thoughts?
Shane
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org