You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nathan Coast <na...@codeczar.com> on 2006/11/07 11:27:11 UTC

[M2] additive module dependencies

Hi,

I'm fairly new to maven 2 and am having some trouble with module 
dependencies.

I have a war project that builds fine when I build it in isolation. 
However, when it is built from the parent project (via the modules 
mechanism) all of the dependencies from all of the modules end up in the 
   WEB-INF/lib directory.  This includes plugin dependencies which are 
only needed at build-time.

Fairly obviously I have done something wrong, I just can't see what. 
Feel free to rtfm me if I've missed the relevant docs :)

cheers
Nathan


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


Re: [M2] additive module dependencies

Posted by Nathan Coast <na...@codeczar.com>.
Hi Arnaud,

apologies for not being clearer in my first email, I'll try to explain 
better now.

I have a parent pom which contains some dependencies and two child 
projects included via modules.

parent pom.xml
    <modules>
         <module>../child1</module>
         <module>../child2</module>
     </modules>

if I execute 'child1>mvn install' then the war is built correctly with 
only the deps I need at runtime.

if I execute 'parent>mvn install' the child war is built except the 
WEB-INF/lib contains many additional jars which are only required at 
build time.

confused?  I am :)

cheers
Nathan

Arnaud Bailly wrote:
> Nathan Coast <na...@codeczar.com> writes:
> 
>> Hi,
>>
>> I'm fairly new to maven 2 and am having some trouble with module
>> dependencies.
>>
>> I have a war project that builds fine when I build it in
>> isolation. However, when it is built from the parent project (via the
>> modules mechanism) all of the dependencies from all of the modules end
>> up in the WEB-INF/lib directory.  This includes plugin dependencies
>> which are only needed at build-time.
>>
> 
> Hello,
> I am deducing (maybe wrongly) from your post that your module do not
> use parent pom which defines dependencies that are then included in
> the war file. 
> 
> There is a notion of scope for dependencies that handles just this
> problem.
> 
>> Fairly obviously I have done something wrong, I just can't see
>> what. Feel free to rtfm me if I've missed the relevant docs :)
>>
> 
> Maybe readin Better Build With Maven would help :-) Look at
> maven.apache.org/guides for more info.
> 
> regards


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


Re: [M2] additive module dependencies

Posted by Arnaud Bailly <ab...@oqube.com>.
Nathan Coast <na...@codeczar.com> writes:

> Hi,
>
> I'm fairly new to maven 2 and am having some trouble with module
> dependencies.
>
> I have a war project that builds fine when I build it in
> isolation. However, when it is built from the parent project (via the
> modules mechanism) all of the dependencies from all of the modules end
> up in the WEB-INF/lib directory.  This includes plugin dependencies
> which are only needed at build-time.
>

Hello,
I am deducing (maybe wrongly) from your post that your module do not
use parent pom which defines dependencies that are then included in
the war file. 

There is a notion of scope for dependencies that handles just this
problem.

> Fairly obviously I have done something wrong, I just can't see
> what. Feel free to rtfm me if I've missed the relevant docs :)
>

Maybe readin Better Build With Maven would help :-) Look at
maven.apache.org/guides for more info.

regards
-- 
OQube < software engineering \ génie logiciel >
Arnaud Bailly, Dr.
\web> http://www.oqube.com


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