Hi

thanks for your reply... I read the maven dependency mechanism and I
understud how it's works...

The definition of  'provided' scope is that "is only available on the
compilation and test classpath" and the user should provide the
dependency at runtime.
And the definition of 'runtime' scopoe is that "the dependency is not
required for compilation"

so my question is: why the provided transitive dependency is NOT
included in 'compile' classpath and the 'runtime' transitive
dependency IS included in the compile classpath?

Furthermore IMHO this behavior could break some builds (see my little
example) because if the project A needs B at compile time and the
project B needs C at compile time.. for the 'transitivity' theorem
also A might need of C at compile time, isn't it?.

thanks
ciao
--
Marco Speranza <[email protected]>
Google Code: http://code.google.com/u/marco.speranza79/


2012/7/18 abhijith tn <[email protected]>:
> Hi Marco,
>
> It is very simple. Maven stops searching for the dependency when it finds
> provided scope and maven assumes the dependency will be provided
> externally. Best example being server library jars like servlet-api jar.
>
> Below link will give you clear picture
>
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
>
> On Tue, Jul 17, 2012 at 2:44 PM, Marco Speranza 
> <[email protected]>wrote:
>
>> Hi all...
>>
>> a friend of mine and I have experienced a compilation error when we
>> have tried to compile this project:
>>
>> prj.a:
>> public class A extends B{}
>>
>> prj.b:
>> public class B extends C{}
>>
>> prj.c:
>> public class C{}
>>
>> where their pom are:
>>
>> prj.a -> prj.b (provided scope)
>>
>> prj.b -> prj.c (provided scope)
>>
>> our compilation fails because C is not included in A's compile
>> classpath as shown in the table [1]
>>
>> My question is... why the transitive 'provided' dependencies of a
>> 'provided' dependency are not transitive and the transitive
>> *'runtime'* dependencies of a 'provided' dependency is transitive?
>>
>> IMHO would be better that provided dependencies are transitive and
>> runtime dependencies not, it isn't?
>>
>>
>> have a nice day... :-)
>>
>>
>> [1]:
>> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
>>
>>
>> --
>> Marco Speranza <[email protected]>
>> Google Code: http://code.google.com/u/marco.speranza79/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to