Thanks for that sample.  It helps out a lot.  I was wondering why we have 
to depend on maven-model?  What is that for?

Thanks.


_Mang




Maria Odea Ching <[EMAIL PROTECTED]> 
01/30/2006 10:17 PM
Please respond to
"Maven Users List" <users@maven.apache.org>


To
Maven Users List <users@maven.apache.org>
cc

Subject
Re: [m2] parent pom






Hi Fredy,

The concept of parent poms can be applied to multi-module projects 
wherein it provides you the priviledge of building your modules 
individually or as a whole (project).
You need to define your parent pom in your project's root directory (ex. 
C:\Project\pom.xml ) and the children pom in each module's root 
directory (ex. C:\Project\module-1\pom.xml).

Please take a look below at the sample parent and child poms.

Parent POM:
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>sample.project</groupId>
  <artifactId>sample</artifactId>
  <packaging>pom</packaging>
  <name>Sample Project</name>
  <version>1.0-SNAPSHOT</version>
  <description>This is a sample project</description>
  <modules>
    <module>module-1</module>
    <module>module-2</module>
    <module>module-3</module>
  </modules>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>2.0</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
</project>


Module-1 Child POM:
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
  <parent>
    <groupId>sample.project</groupId>
    <artifactId>sample</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>module-1</artifactId>
  <name>Sample Project Module 1</name>
  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
    </dependency>
  </dependencies>
</project>

Thanks,
Odea


Fredy wrote:

>hi,
>i've read something about the parent pom at multiple places, but have not 
found an explanation about it.
>Is there a doc about parent pom's? Where to define it, how to extend it?? 
Do it mean a pom in a multi module project like mojo-sandbox?
>
>Fredy
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
> 
>


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


Reply via email to