Why do you not create 3 projects like this :

root
  - pom.xml
  - jar_project
     -pom.xml
  - war_project
     -pom.xml

In your war project, you add a dependency to your jar.
Your other internal projects will use the project_jar as dependency.

Emmanuel

Frank Russo a écrit :
Does anyone know if this is possible? Just checking in case it was
missed...

Frank Russo
Senior Developer
FX Alliance, LLC


-----Original Message-----
From: Frank Russo Sent: Tuesday, January 31, 2006 12:05 PM
To: Maven Users List
Subject: RE: [m2] parent pom

Does anyone know if the following is doable? I have a project where I
build two different artifacts off the same project base. One is a war
file, which we use to deploy to a tomcat server. The other is a jar
file, which is just an api snapshot of our code for other internal
projects to share. The way I'm doing it now, is as follows.

+- project-root
| +- pom.xml
| +- pom_war.xml
| +- pom_jar.xml
| +- src
...

The pom.xml is my parent, which defines all of the shared definitions
(includes repositories, dependencies, profiles, etc.) The other two
reference the parent and build the appropriate artifacts. What I have
been doing is build the parent, build child one, and then build child
two.
As noted in prior emails, there is a way to do one build and generate
all artifacts, however, the examples in the docs referenced below, do
not handle my scenario.
My questions is, is what I want possible to do? If so, how do I
configure the <modules/> element in the parent? If not, is there a
workaround for what I want to do, besides writing a script? A script may
not be such a bad option, but it just adds something that I'll need to
maintain if we want to add artifacts...

Frank Russo
Senior Developer
FX Alliance, LLC


-----Original Message-----
From: Richard Allen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 31, 2006 9:54 AM
To: Maven Users List
Subject: Re: [m2] parent pom

See "How do I build more than one project at once?" here:
http://maven.apache.org/guides/getting-started/index.html

If you are using Eclipse, this can be useful:
http://maven.apache.org/guides/mini/guide-ide-eclipse.html

Otherwise, search the mail:
http://www.nabble.com/Maven---Users-f178.html


Richard Allen


Frank Russo wrote:


Do you or anyone else know where (if it exists) the documention is for this? The pom descriptor only shows <modules/>.

If anyone knows how to use this, please pass along.
Thanks...

Frank Russo
Senior Developer
FX Alliance, LLC


-----Original Message-----
From: Richard Allen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 31, 2006 8:57 AM
To: Maven Users List
Subject: Re: [m2] parent pom

If your parent project POM lists <modules>, then those projects will be


built when the parent is built.

Richard Allen



Frank Russo wrote:




I have a question in regards to this. Is there a way to build the projects as a whole, as you say? As of now, I have to run maven on each




individual child, and I'm not sure if there is one way to call maven to




run the parent and all children at once.

Does anyone know if this is doable?

Frank Russo
Senior Developer
FX Alliance, LLC


-----Original Message-----
From: Maria Odea Ching [mailto:[EMAIL PROTECTED]
Sent: Monday, January 30, 2006 10:17 PM
To: Maven Users List
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]




---------------------------------------------------------------------
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]




---------------------------------------------------------------------
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]




---------------------------------------------------------------------
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]






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

Reply via email to