You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Joachim Van der Auwera <jo...@triathlon98.com> on 2006/11/06 00:56:54 UTC

problem with "provided" scope

I am using maven 2.0.4

In my project, I have some artifacts which are defined as "provided" 
scope as these artifacts should not be included in the war file. So far 
so good.

However, once I change the scope, my project does not *compile* any more 
as the artifacts seem to have disappeared from the compile classpath as 
well.

I have defined the scope in my global pom (in dependecyManagement 
section) and the classes which reference these are in a module, where 
the dependency is mentioned without scope (or version).

What am I doing wrong?

Thanks for the help,
Joachim

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


Re: problem with "provided" scope

Posted by pjungwir <ma...@9stmaryrd.com>.
I believe that <dependencyManagement> does not actually add dependencies. It
just specifies which version should be used if a child adds that dependency.
So instead of using dependencyManagement, perhaps you should try
<dependencies>.

Paul




Joachim Van der Auwera wrote:
> 
> Thanks for the help.
> 
> I had at least two libraries with this problem, and one of them did not 
> have any transitive dependencies, the other one has. So unfortunely, it 
> cannot be just that.
> 
> Any other ideas?
> 
> Thanks for the help,
> Joachim
> 
> Edwin Punzalan wrote:
>>
>> hmm... I'm pretty sure the provided scoped artifacts appear in the 
>> compile phase... maybe what your project is missing are the transitive 
>> dependencies of the provided artifact?
>>
>> Joachim Van der Auwera wrote:
>>> I am using maven 2.0.4
>>>
>>> In my project, I have some artifacts which are defined as "provided" 
>>> scope as these artifacts should not be included in the war file. So 
>>> far so good.
>>>
>>> However, once I change the scope, my project does not *compile* any 
>>> more as the artifacts seem to have disappeared from the compile 
>>> classpath as well.
>>>
>>> I have defined the scope in my global pom (in dependecyManagement 
>>> section) and the classes which reference these are in a module, where 
>>> the dependency is mentioned without scope (or version).
>>>
>>> What am I doing wrong?
>>>
>>> Thanks for the help,
>>> Joachim
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/problem-with-%22provided%22-scope-tf2579617s177.html#a7327408
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: problem with "provided" scope

Posted by Joachim Van der Auwera <jo...@progs.be>.
Thanks for the help.

I had at least two libraries with this problem, and one of them did not 
have any transitive dependencies, the other one has. So unfortunely, it 
cannot be just that.

Any other ideas?

Thanks for the help,
Joachim

Edwin Punzalan wrote:
>
> hmm... I'm pretty sure the provided scoped artifacts appear in the 
> compile phase... maybe what your project is missing are the transitive 
> dependencies of the provided artifact?
>
> Joachim Van der Auwera wrote:
>> I am using maven 2.0.4
>>
>> In my project, I have some artifacts which are defined as "provided" 
>> scope as these artifacts should not be included in the war file. So 
>> far so good.
>>
>> However, once I change the scope, my project does not *compile* any 
>> more as the artifacts seem to have disappeared from the compile 
>> classpath as well.
>>
>> I have defined the scope in my global pom (in dependecyManagement 
>> section) and the classes which reference these are in a module, where 
>> the dependency is mentioned without scope (or version).
>>
>> What am I doing wrong?
>>
>> Thanks for the help,
>> Joachim
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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


Re: problem with "provided" scope

Posted by Edwin Punzalan <ep...@exist.com>.
This is what you currently have:

   B -> A -> X

if X is provided scoped in A, then B needs to declare X.


Joachim Van der Auwera wrote:
> Let me correct what I said in my other mail, it does indeed have 
> something to do with transitive dependencies.
> - I have module A which depends on provided library X.
> - I have module B which depends on module A and on (provided) library X
> When library X is not marked as provided, all compiles fine.
> When I mark library X as provided in module A, then I also need to add 
> an explicit dependency on module B.
>
> Is that the intended behaviour?
>
> Thanks again for helping,
> Joachim
>
>
>
> Edwin Punzalan wrote:
>>
>> hmm... I'm pretty sure the provided scoped artifacts appear in the 
>> compile phase... maybe what your project is missing are the 
>> transitive dependencies of the provided artifact?
>>
>> Joachim Van der Auwera wrote:
>>> I am using maven 2.0.4
>>>
>>> In my project, I have some artifacts which are defined as "provided" 
>>> scope as these artifacts should not be included in the war file. So 
>>> far so good.
>>>
>>> However, once I change the scope, my project does not *compile* any 
>>> more as the artifacts seem to have disappeared from the compile 
>>> classpath as well.
>>>
>>> I have defined the scope in my global pom (in dependecyManagement 
>>> section) and the classes which reference these are in a module, 
>>> where the dependency is mentioned without scope (or version).
>>>
>>> What am I doing wrong?
>>>
>>> Thanks for the help,
>>> Joachim
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: problem with "provided" scope

Posted by Joachim Van der Auwera <jo...@triathlon98.com>.
Let me correct what I said in my other mail, it does indeed have 
something to do with transitive dependencies.
- I have module A which depends on provided library X.
- I have module B which depends on module A and on (provided) library X
When library X is not marked as provided, all compiles fine.
When I mark library X as provided in module A, then I also need to add 
an explicit dependency on module B.

Is that the intended behaviour?

Thanks again for helping,
Joachim



Edwin Punzalan wrote:
>
> hmm... I'm pretty sure the provided scoped artifacts appear in the 
> compile phase... maybe what your project is missing are the transitive 
> dependencies of the provided artifact?
>
> Joachim Van der Auwera wrote:
>> I am using maven 2.0.4
>>
>> In my project, I have some artifacts which are defined as "provided" 
>> scope as these artifacts should not be included in the war file. So 
>> far so good.
>>
>> However, once I change the scope, my project does not *compile* any 
>> more as the artifacts seem to have disappeared from the compile 
>> classpath as well.
>>
>> I have defined the scope in my global pom (in dependecyManagement 
>> section) and the classes which reference these are in a module, where 
>> the dependency is mentioned without scope (or version).
>>
>> What am I doing wrong?
>>
>> Thanks for the help,
>> Joachim
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


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


Re: problem with "provided" scope

Posted by Edwin Punzalan <ep...@exist.com>.
hmm... I'm pretty sure the provided scoped artifacts appear in the 
compile phase... maybe what your project is missing are the transitive 
dependencies of the provided artifact?

Joachim Van der Auwera wrote:
> I am using maven 2.0.4
>
> In my project, I have some artifacts which are defined as "provided" 
> scope as these artifacts should not be included in the war file. So 
> far so good.
>
> However, once I change the scope, my project does not *compile* any 
> more as the artifacts seem to have disappeared from the compile 
> classpath as well.
>
> I have defined the scope in my global pom (in dependecyManagement 
> section) and the classes which reference these are in a module, where 
> the dependency is mentioned without scope (or version).
>
> What am I doing wrong?
>
> Thanks for the help,
> Joachim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: problem with "provided" scope

Posted by Federico Yankelevich <fy...@sobacosoftware.ch>.
Hi,
you said : "I have defined the scope in my global pom (in
dependecyManagement section) and the classes which reference these are in a
module, where the dependency is mentioned without scope (or version)."

I usually define version in the dependencyManagement section (in parent pom)
but scope in the dependencies tag of the children pom (the one really having
this dependency) 

hope this help,
bye,
Federico


Joachim Van der Auwera-2 wrote:
> 
> I am using maven 2.0.4
> 
> In my project, I have some artifacts which are defined as "provided" 
> scope as these artifacts should not be included in the war file. So far 
> so good.
> 
> However, once I change the scope, my project does not *compile* any more 
> as the artifacts seem to have disappeared from the compile classpath as 
> well.
> 
> I have defined the scope in my global pom (in dependecyManagement 
> section) and the classes which reference these are in a module, where 
> the dependency is mentioned without scope (or version).
> 
> What am I doing wrong?
> 
> Thanks for the help,
> Joachim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/problem-with-%22provided%22-scope-tf2579617s177.html#a7197792
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