You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Fabien Coppens <fa...@free.fr> on 2008/05/24 16:18:12 UTC

How to inherit dependencies for compile+tests but not package them in the build ?

Hi all.
I have several modules that have a dependency on a PERSISTENCE module.
Said Persistence module has a bunch of dependencies on jars of scope 
"provided" because
they will actually be available directly in the app server's 
out-of-the-box libraries.
My modules that depend on Persistence need to see the libraries that 
Persistence declares
in its Pom, both for compilation and for tests (UTs are run outside of 
the app server), BUT since
those jars are declared with scope "provided" in the Persistence 
module's Pom, the command line
build fails (the build actually works in Eclipse because the M2Eclipse 
plugin apparently ignores the scope
for compilation, because I see all the jars in the maven dependancies in 
Eclipse, but I'm straying from the point here).
Ok a basic solution would be to copy-paste all those provided-scoped 
library dependencies into the Poms
of all projects that have a dependency on Persistence, but that is 
cumbersome and error prone.
If anyone has a better idea, I'm a taker.
Fabien


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


Re: How to inherit dependencies for compile+tests but not package them in the build ?

Posted by Fabien Coppens <fa...@free.fr>.
Yes I've tired that, but if that dummy module has a provided or test scope,
the problem is the same : the dependencies are lost to transitivity.

Stephen Connolly wrote:

>You could have a second (dummy) module that depends on persistence, has all
>it's dependencies, and then just add that as either scope provided or test
>to the modules that you need
>
>On Sat, May 24, 2008 at 4:11 PM, Fabien Coppens <fa...@free.fr>
>wrote:
>
>  
>
>>Yes, but doesn't that mean adding the list of build exclusions to each and
>>every
>>project that has a dependency on Persistence (because they are each being
>>tested and built
>>sperately by different teams) ? It's as cumbersome as adding the whole list
>>of dependencies
>>with "provided" scope in each of those modules;
>>
>>
>>Bryan Loofbourrow wrote:
>>
>> I have several modules that have a dependency on a PERSISTENCE
>>    
>>
>>>>>          
>>>>>
>>>>module.
>>>>        
>>>>
>>>Said Persistence module has a bunch of dependencies on jars of scope
>>>"provided" because
>>>they will actually be available directly in the app server's
>>>out-of-the-box libraries.
>>>My modules that depend on Persistence need to see the libraries that
>>>Persistence declares
>>>in its Pom, both for compilation and for tests (UTs are run outside of the
>>>app server), BUT since
>>>those jars are declared with scope "provided" in the Persistence module's
>>>Pom, the command line
>>>build fails <<
>>>
>>>I can see how "provided" is of limited usefulness in this situation,
>>>being non-transitive. So why not use "compile" scope and filter those
>>>jars out when you build your deployable war/ear?
>>>
>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>
>>    
>>
>
>  
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG. 
>Version: 7.5.524 / Virus Database: 269.24.1/1463 - Release Date: 5/23/2008 3:36 PM
>  
>


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


Re: How to inherit dependencies for compile+tests but not package them in the build ?

Posted by Stephen Connolly <st...@gmail.com>.
You could have a second (dummy) module that depends on persistence, has all
it's dependencies, and then just add that as either scope provided or test
to the modules that you need

On Sat, May 24, 2008 at 4:11 PM, Fabien Coppens <fa...@free.fr>
wrote:

> Yes, but doesn't that mean adding the list of build exclusions to each and
> every
> project that has a dependency on Persistence (because they are each being
> tested and built
> sperately by different teams) ? It's as cumbersome as adding the whole list
> of dependencies
> with "provided" scope in each of those modules;
>
>
> Bryan Loofbourrow wrote:
>
>  I have several modules that have a dependency on a PERSISTENCE
>>>>
>>>>
>>> module.
>> Said Persistence module has a bunch of dependencies on jars of scope
>> "provided" because
>> they will actually be available directly in the app server's
>> out-of-the-box libraries.
>> My modules that depend on Persistence need to see the libraries that
>> Persistence declares
>> in its Pom, both for compilation and for tests (UTs are run outside of the
>> app server), BUT since
>> those jars are declared with scope "provided" in the Persistence module's
>> Pom, the command line
>> build fails <<
>>
>> I can see how "provided" is of limited usefulness in this situation,
>> being non-transitive. So why not use "compile" scope and filter those
>> jars out when you build your deployable war/ear?
>>
>>
>> ---------------------------------------------------------------------
>> 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: How to inherit dependencies for compile+tests but not package them in the build ?

Posted by Fabien Coppens <fa...@free.fr>.
Yes, but doesn't that mean adding the list of build exclusions to each 
and every
project that has a dependency on Persistence (because they are each 
being tested and built
sperately by different teams) ? It's as cumbersome as adding the whole 
list of dependencies
with "provided" scope in each of those modules;

Bryan Loofbourrow wrote:

>>>I have several modules that have a dependency on a PERSISTENCE
>>>      
>>>
>module.
>Said Persistence module has a bunch of dependencies on jars of scope 
>"provided" because
>they will actually be available directly in the app server's 
>out-of-the-box libraries.
>My modules that depend on Persistence need to see the libraries that 
>Persistence declares
>in its Pom, both for compilation and for tests (UTs are run outside of 
>the app server), BUT since
>those jars are declared with scope "provided" in the Persistence 
>module's Pom, the command line
>build fails <<
>
>I can see how "provided" is of limited usefulness in this situation,
>being non-transitive. So why not use "compile" scope and filter those
>jars out when you build your deployable war/ear?
>
>
>---------------------------------------------------------------------
>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: How to inherit dependencies for compile+tests but not package them in the build ?

Posted by Bryan Loofbourrow <br...@qpass.com>.
>> I have several modules that have a dependency on a PERSISTENCE
module.
Said Persistence module has a bunch of dependencies on jars of scope 
"provided" because
they will actually be available directly in the app server's 
out-of-the-box libraries.
My modules that depend on Persistence need to see the libraries that 
Persistence declares
in its Pom, both for compilation and for tests (UTs are run outside of 
the app server), BUT since
those jars are declared with scope "provided" in the Persistence 
module's Pom, the command line
build fails <<

I can see how "provided" is of limited usefulness in this situation,
being non-transitive. So why not use "compile" scope and filter those
jars out when you build your deployable war/ear?


---------------------------------------------------------------------
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: How to inherit dependencies for compile+tests but not package them in the build ?

Posted by Wendy Smoak <ws...@gmail.com>.
On Sat, May 24, 2008 at 7:18 AM, Fabien Coppens <fa...@free.fr> wrote:
> Ok a basic solution would be to copy-paste all those provided-scoped library
> dependencies into the Poms
> of all projects that have a dependency on Persistence, but that is
> cumbersome and error prone.

Would the new 'import' scope in Maven 2.0.9 help with this?

http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies

-- 
Wendy

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