Re: RE : [m2] Inter-project dependency question - forced to package sub-module dependencies manually?

2006-03-29 Thread Wayne Fay
This is exactly correct.

If you want to build and package *only* your submodule, then Maven
needs to have the other dependencies already installed in your local
repo... it won't go find them, build, and use them even if they share
a parent.

This will work if executed from the top/parent pom. Then all artifacts
will be built "in order" and you don't need to install the various
module/submodules.

Wayne


On 3/29/06, Chris Wall <[EMAIL PROTECTED]> wrote:
> Thanks Gareth.
>
> It sounds as if Maven doesn't have the ability to determine and resolve
> inter-project dependencies when packaging a child.
>
> If a sub-module-A has a dependency on a module-B and module-B isn't
> package, Maven will not package module-B prior to packaging
> sub-module-A.  Again, this is if Maven is executed from sub-module-A.  I
> figured that since the pom.xmls were linked via parent, artifactIds, and
> module names, that Maven would have the information needed to resolve
> the dependency.
>
> Instead, from what I understand, you have to build all your dependency
> modules first, prior to packaging your sub-modules.  From the root
> pom.xml everything works well, but if I just want to work with a
> sub-module, than extra steps are required.
>
> -Chris
>
> -Original Message-
> From: Gareth Western [mailto:[EMAIL PROTECTED]
> Sent: March 28, 2006 2:50 PM
> To: Maven Users List
> Subject: Re: RE : [m2] Inter-project dependency question
>
> Hi Chris,
>
> I'm not sure if this is the BEST way to do it, but what I do is create a
> parent pom.xml in the root directory. Then add commons, web-app, and
> stand-alone app as modules in that parent POM. Maven should figure out
> that
> since webapp and standalone app are dependent on the commons module then
> that's what needs to be built first. Then when you call "mvn package"
> (or
> whatever your goal is) on the parent pom, maven will first do the
> commons
> module before anything else. You'll also need to add  tags to
> your
> sub-project (commons, web-app, and stand-alone app).
>
> See the example in the documentation at
> http://maven.apache.org/guides/getting-started/index.html#How%20do%20I%2
> 0build%20more%20than%20one%20project%20at%20once
> ?
> for more details
>
> Hope that helps!
>
> ~Gareth
>
> On 3/28/06, Chris Wall <[EMAIL PROTECTED]> wrote:
> >
> > Thanks Olivier.
> >
> > How do I represent this dependency in my webapp pom.xml?  I have the
> > following dependency declaration, but M2 tries to download the jar
> instead
> > of resolving that this is internally provided dependency.
> >
> >
> > 
> >   my-common
> >my-common
> >   1.0-SNAPSHOT
> > 
> >
> >
> ___
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual
> or entity named in this message. If you are not the intended recipient,
> and have received this message in error, please immediately return this
> by email and then delete it.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


RE : [m2] Inter-project dependency question - forced to package sub-module dependencies manually?

2006-03-29 Thread Chris Wall
Thanks Gareth.

It sounds as if Maven doesn't have the ability to determine and resolve
inter-project dependencies when packaging a child.

If a sub-module-A has a dependency on a module-B and module-B isn't
package, Maven will not package module-B prior to packaging
sub-module-A.  Again, this is if Maven is executed from sub-module-A.  I
figured that since the pom.xmls were linked via parent, artifactIds, and
module names, that Maven would have the information needed to resolve
the dependency.

Instead, from what I understand, you have to build all your dependency
modules first, prior to packaging your sub-modules.  From the root
pom.xml everything works well, but if I just want to work with a
sub-module, than extra steps are required.

-Chris

-Original Message-
From: Gareth Western [mailto:[EMAIL PROTECTED] 
Sent: March 28, 2006 2:50 PM
To: Maven Users List
Subject: Re: RE : [m2] Inter-project dependency question

Hi Chris,

I'm not sure if this is the BEST way to do it, but what I do is create a
parent pom.xml in the root directory. Then add commons, web-app, and
stand-alone app as modules in that parent POM. Maven should figure out
that
since webapp and standalone app are dependent on the commons module then
that's what needs to be built first. Then when you call "mvn package"
(or
whatever your goal is) on the parent pom, maven will first do the
commons
module before anything else. You'll also need to add  tags to
your
sub-project (commons, web-app, and stand-alone app).

See the example in the documentation at
http://maven.apache.org/guides/getting-started/index.html#How%20do%20I%2
0build%20more%20than%20one%20project%20at%20once
?
for more details

Hope that helps!

~Gareth

On 3/28/06, Chris Wall <[EMAIL PROTECTED]> wrote:
>
> Thanks Olivier.
>
> How do I represent this dependency in my webapp pom.xml?  I have the
> following dependency declaration, but M2 tries to download the jar
instead
> of resolving that this is internally provided dependency.
>
>
> 
>   my-common
>my-common
>   1.0-SNAPSHOT
> 
>
>
___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]