You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by houzecl <ch...@etat.ge.ch> on 2009/08/10 20:09:35 UTC

Dependency Scope Usage: Request for some precision

Usage of dependency scope is critical for project build, and I'd like to make
sure that I can use <scope>import</scope> in a valid way.

Maven site documentation states
(http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope): 

"import (only available in Maven 2.0.9 or later)
This scope is only used on a dependency of type pom in the
<dependencyManagement> section. It indicates that the specified POM should
be replaced with the dependencies in that POM's <dependencyManagement>
section. 

However Maven does not prevent to build a project with a pom contains
something like this, outside of the dependencyManagement section:

	<dependencies>

		<dependency>
			<artifactId>pom_my_libraries</artifactId>
			<groupId>company.libraries</groupId>
			<type>pom</type>
			<version>x.y.z-SNAPSHOT</version>
			<scope>import</scope>
		</dependency>

The result is very different from inserting such a dependency within the 
<dependencyManagement> section. One should think that all dependencies
specified in the imported pom would be inserted "as is" 
However, it does not seem to be the case: e.g. most of the "compile"
dependencies turn to "runtime". The rules that affect transitive
dependencies does not seem to apply here.

Therefore my questions are:

1) is it valid to use scope import outside of the dependencyManagement
section ?

and if yes:

2) what are the rules applied on imported dependencies scopes in that case ?

Thanks,

Christian-Luc
-- 
View this message in context: http://www.nabble.com/Dependency-Scope-Usage%3A-Request-for-some-precision-tp24904584p24904584.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Dependency Scope Usage: Request for some precision

Posted by Alexander <th...@gmail.com>.
HI,

I think ref clearly pointing you that such use is *invalid*

2009/8/11 houzecl <ch...@etat.ge.ch>

>
> Usage of dependency scope is critical for project build, and I'd like to
> make
> sure that I can use <scope>import</scope> in a valid way.
>
> Maven site documentation states
> (
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
> ):
>
> "import (only available in Maven 2.0.9 or later)
> This scope is only used on a dependency of type pom in the
> <dependencyManagement> section. It indicates that the specified POM should
> be replaced with the dependencies in that POM's <dependencyManagement>
> section.
>
> However Maven does not prevent to build a project with a pom contains
> something like this, outside of the dependencyManagement section:
>
>        <dependencies>
>
>                <dependency>
>                        <artifactId>pom_my_libraries</artifactId>
>                        <groupId>company.libraries</groupId>
>                        <type>pom</type>
>                        <version>x.y.z-SNAPSHOT</version>
>                        <scope>import</scope>
>                </dependency>
>
> The result is very different from inserting such a dependency within the
> <dependencyManagement> section. One should think that all dependencies
> specified in the imported pom would be inserted "as is"
> However, it does not seem to be the case: e.g. most of the "compile"
> dependencies turn to "runtime". The rules that affect transitive
> dependencies does not seem to apply here.
>
> Therefore my questions are:
>
> 1) is it valid to use scope import outside of the dependencyManagement
> section ?
>
> and if yes:
>
> 2) what are the rules applied on imported dependencies scopes in that case
> ?
>
> Thanks,
>
> Christian-Luc
> --
> View this message in context:
> http://www.nabble.com/Dependency-Scope-Usage%3A-Request-for-some-precision-tp24904584p24904584.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Regards,
Alexander