Sure, the inheritance is transitive. You can have as many levels as you want:
If you have a hierarchy like this:

 * A
     o B
         + C

All dependencies declared in A will also be available for B and C and all dependencies declared in B will also be available for C.

Guillaume

Le 29/09/2011 12:57, Kiren Pillay a écrit :
Thanks for the explanation Guillame...this works as you've stated.

However my question is, is the inheritance transitive, i.e, the child
pom would inherit the dependencies of the "grandparent" pom? From what
I'm seeing this is not the case.

Regards

On Thu, Sep 29, 2011 at 11:43 AM, Guillaume Polet
<guillaume.po...@gmail.com>  wrote:
I am not sure I understood you correctly but here is what I can tell:
Let's say you have a Main project which contains two modules: dao and
business:

  * Main
     o dao
     o business

If in your Main pom.xml,  you have defined the following:
<groupId>a.b.c</groupId>
<artifactId>Main</artifactId>
<version>1.0<version>

<dependencies>
<dependency>
<groupId>x.y.z</groupId>
<artifactId>azerty</artifactId>
<version>1.0</version>
</dependency>
<dependencies>

If in your dao pom.xml, you have defined the following
<parent>
<groupId>a.b.c</groupId>
<artifactId>Main</artifactId>
<version>1.0<version>
</parent>

then yes, you should inherit the dependency provided in you Main pom.xml,
ie, in my example:
<groupId>x.y.z</groupId>
<artifactId>azerty</artifactId>
<version>1.0</version>

Without any more information, it will be hard to help more I think.

Cheers,
Guillaume
Le 29/09/2011 11:32, Kiren Pillay a écrit :
Hi All

We have a project with multi-level modules.


Main ---- core------dao
          +---business

  From what I've read, if I've defined the dependency in the Main
module, I don't need to repeat the defintion the dao module. Is this
correct, because it doesn't seem to work for me?

Regards
Kiren

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


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


Reply via email to