You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by TJ Greenier <tj...@gmail.com> on 2006/03/24 18:07:16 UTC
Multiple Project Builds
Hi all,
I used Maven in the past and I am trying to get up to speed with Maven 2.0.
I have a question regarding multiple projects and was hoping that someone
can point me in the right directions, as I am getting a little confused.
My intentions:
I have a project that can be separated as client, server and common code
bases.
I want to be able to check out each one independently to build and unit
test.
I also want to be able to build the project as a whole in which I would get
two resulting archive files (say client.jar and server.war)
Currently my project is structured as follows:
MyProject
- ClientProject
- packages....
- pom.xml (jar type)
- ServerProject
- packages....
- pom.xml (war type)
- CommonProject
- packages....
- pom.xml (jar type, this project is used by both client and server)
- pom.xml
The MyProject pom.xml content:
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company.project</groupId>
<artifactId>MyProject</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>MyProject</name>
<modules>
<module>ClientProject</module>
<module>ServerProject</module>
<module>CommonProject</module>
</modules>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
My Issues:
I can currently build each project separately, but I am struggling with
building the over all project and getting two archives (jar and war).
I am open to suggestions if I am going about this the wrong way, but I was
hoping that someone could point me to an example or link that would help me
work through this. My thoughts were that the pom packaging would just
execute the packaging for each subproject, thus getting me the client.jarand
server.war files that I need.
My project is currently using Ant and has duplicated a lot of what Maven can
do in a nonstandard manner. I am hoping to use Maven 2.0 to cleanup our
build process and remove some of our issues with our current build process.
Many thanks in advance.
T.J. Greenier
Re: Multiple Project Builds
Posted by Paul Li <pa...@gmail.com>.
thanks Dan,
I assume that build-helper is what we need here :-) I will try to set
it up and reply to how i went as well.
cheers,
pauli
On 3/26/06, TJ Greenier <tj...@gmail.com> wrote:
> Dan,
>
> Thank you for the links. I think those example will help me out. I plan to
> work on that later today or tomorrow. If I get this working I will reply
> with how I set it up.
>
> Thanks,
> TJ
>
> On 3/24/06, dan tran <da...@gmail.com> wrote:
> >
> > did you take a look at the project source for http://mojo.codehaus.org or
> > maven2 http://svn.apache.org/repos/asf/maven?
> >
> >
> >
> > -D
> >
> >
> > On 3/24/06, Paul Li <pa...@gmail.com> wrote:
> > >
> > > Hi TJ,
> > > I have the same problem. if anyone know of an example pom.xml that
> > > would be great!
> > >
> > >
> > > I remember reading from the maven documentations, that you have to set
> > > the project up in a particular directory structure to get this to
> > > work. Which is no good for me :-(
> > >
> > > I recall the directory you need is:
> > >
> > > /ParentProjDirectory
> > > pom.xml (put your modules etc)
> > > /ParentProjDirectory/Child#1ProjDirectory
> > > pom.xml (put a reference to the parent project)
> > > /ParentProjDirectory/Child#2ProjDirectory
> > > pom.xml (put a reference to parent project)
> > > /ParentProjDirectory/Child#3ProjDirectory
> > > pom.xml (put a reference to the parent project)
> > >
> > >
> > > What I want is the directory structure you outlined below, cos this is
> > > a lot better from a development perspective, as ppl could just check
> > > out the bit they are working on, not everything. But so far I haven't
> > > had a lot mileage on this one.
> > >
> > > Can anyone else shed some light here?
> > >
> > >
> > > cheers,
> > >
> > >
> > > paul
> > >
> > > On 3/25/06, TJ Greenier <tj...@gmail.com> wrote:
> > > > Hi all,
> > > >
> > > > I used Maven in the past and I am trying to get up to speed with Maven
> > > 2.0.
> > > > I have a question regarding multiple projects and was hoping that
> > > someone
> > > > can point me in the right directions, as I am getting a little
> > confused.
> > > >
> > > > My intentions:
> > > > I have a project that can be separated as client, server and common
> > code
> > > > bases.
> > > > I want to be able to check out each one independently to build and
> > unit
> > > > test.
> > > > I also want to be able to build the project as a whole in which I
> > would
> > > get
> > > > two resulting archive files (say client.jar and server.war)
> > > >
> > > > Currently my project is structured as follows:
> > > > MyProject
> > > > - ClientProject
> > > > - packages....
> > > > - pom.xml (jar type)
> > > > - ServerProject
> > > > - packages....
> > > > - pom.xml (war type)
> > > > - CommonProject
> > > > - packages....
> > > > - pom.xml (jar type, this project is used by both client and server)
> > > > - pom.xml
> > > >
> > > > The MyProject pom.xml content:
> > > > <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">
> > > > <modelVersion>4.0.0</modelVersion>
> > > > <groupId>com.company.project</groupId>
> > > > <artifactId>MyProject</artifactId>
> > > > <version>1.0-SNAPSHOT</version>
> > > > <packaging>pom</packaging>
> > > > <name>MyProject</name>
> > > > <modules>
> > > > <module>ClientProject</module>
> > > > <module>ServerProject</module>
> > > > <module>CommonProject</module>
> > > > </modules>
> > > > <dependencies>
> > > > <dependency>
> > > > <groupId>junit</groupId>
> > > > <artifactId>junit</artifactId>
> > > > <version>3.8.1</version>
> > > > <scope>test</scope>
> > > > </dependency>
> > > > </dependencies>
> > > > </project>
> > > >
> > > > My Issues:
> > > > I can currently build each project separately, but I am struggling
> > with
> > > > building the over all project and getting two archives (jar and war).
> > > > I am open to suggestions if I am going about this the wrong way, but I
> > > was
> > > > hoping that someone could point me to an example or link that would
> > help
> > > me
> > > > work through this. My thoughts were that the pom packaging would just
> > > > execute the packaging for each subproject, thus getting me the
> > > client.jarand
> > > > server.war files that I need.
> > > >
> > > > My project is currently using Ant and has duplicated a lot of what
> > Maven
> > > can
> > > > do in a nonstandard manner. I am hoping to use Maven 2.0 to cleanup
> > our
> > > > build process and remove some of our issues with our current build
> > > process.
> > > >
> > > > Many thanks in advance.
> > > >
> > > > T.J. Greenier
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Multiple Project Builds
Posted by TJ Greenier <tj...@gmail.com>.
Dan,
Thank you for the links. I think those example will help me out. I plan to
work on that later today or tomorrow. If I get this working I will reply
with how I set it up.
Thanks,
TJ
On 3/24/06, dan tran <da...@gmail.com> wrote:
>
> did you take a look at the project source for http://mojo.codehaus.org or
> maven2 http://svn.apache.org/repos/asf/maven?
>
>
>
> -D
>
>
> On 3/24/06, Paul Li <pa...@gmail.com> wrote:
> >
> > Hi TJ,
> > I have the same problem. if anyone know of an example pom.xml that
> > would be great!
> >
> >
> > I remember reading from the maven documentations, that you have to set
> > the project up in a particular directory structure to get this to
> > work. Which is no good for me :-(
> >
> > I recall the directory you need is:
> >
> > /ParentProjDirectory
> > pom.xml (put your modules etc)
> > /ParentProjDirectory/Child#1ProjDirectory
> > pom.xml (put a reference to the parent project)
> > /ParentProjDirectory/Child#2ProjDirectory
> > pom.xml (put a reference to parent project)
> > /ParentProjDirectory/Child#3ProjDirectory
> > pom.xml (put a reference to the parent project)
> >
> >
> > What I want is the directory structure you outlined below, cos this is
> > a lot better from a development perspective, as ppl could just check
> > out the bit they are working on, not everything. But so far I haven't
> > had a lot mileage on this one.
> >
> > Can anyone else shed some light here?
> >
> >
> > cheers,
> >
> >
> > paul
> >
> > On 3/25/06, TJ Greenier <tj...@gmail.com> wrote:
> > > Hi all,
> > >
> > > I used Maven in the past and I am trying to get up to speed with Maven
> > 2.0.
> > > I have a question regarding multiple projects and was hoping that
> > someone
> > > can point me in the right directions, as I am getting a little
> confused.
> > >
> > > My intentions:
> > > I have a project that can be separated as client, server and common
> code
> > > bases.
> > > I want to be able to check out each one independently to build and
> unit
> > > test.
> > > I also want to be able to build the project as a whole in which I
> would
> > get
> > > two resulting archive files (say client.jar and server.war)
> > >
> > > Currently my project is structured as follows:
> > > MyProject
> > > - ClientProject
> > > - packages....
> > > - pom.xml (jar type)
> > > - ServerProject
> > > - packages....
> > > - pom.xml (war type)
> > > - CommonProject
> > > - packages....
> > > - pom.xml (jar type, this project is used by both client and server)
> > > - pom.xml
> > >
> > > The MyProject pom.xml content:
> > > <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">
> > > <modelVersion>4.0.0</modelVersion>
> > > <groupId>com.company.project</groupId>
> > > <artifactId>MyProject</artifactId>
> > > <version>1.0-SNAPSHOT</version>
> > > <packaging>pom</packaging>
> > > <name>MyProject</name>
> > > <modules>
> > > <module>ClientProject</module>
> > > <module>ServerProject</module>
> > > <module>CommonProject</module>
> > > </modules>
> > > <dependencies>
> > > <dependency>
> > > <groupId>junit</groupId>
> > > <artifactId>junit</artifactId>
> > > <version>3.8.1</version>
> > > <scope>test</scope>
> > > </dependency>
> > > </dependencies>
> > > </project>
> > >
> > > My Issues:
> > > I can currently build each project separately, but I am struggling
> with
> > > building the over all project and getting two archives (jar and war).
> > > I am open to suggestions if I am going about this the wrong way, but I
> > was
> > > hoping that someone could point me to an example or link that would
> help
> > me
> > > work through this. My thoughts were that the pom packaging would just
> > > execute the packaging for each subproject, thus getting me the
> > client.jarand
> > > server.war files that I need.
> > >
> > > My project is currently using Ant and has duplicated a lot of what
> Maven
> > can
> > > do in a nonstandard manner. I am hoping to use Maven 2.0 to cleanup
> our
> > > build process and remove some of our issues with our current build
> > process.
> > >
> > > Many thanks in advance.
> > >
> > > T.J. Greenier
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
Re: Multiple Project Builds
Posted by dan tran <da...@gmail.com>.
did you take a look at the project source for http://mojo.codehaus.org or
maven2 http://svn.apache.org/repos/asf/maven?
-D
On 3/24/06, Paul Li <pa...@gmail.com> wrote:
>
> Hi TJ,
> I have the same problem. if anyone know of an example pom.xml that
> would be great!
>
>
> I remember reading from the maven documentations, that you have to set
> the project up in a particular directory structure to get this to
> work. Which is no good for me :-(
>
> I recall the directory you need is:
>
> /ParentProjDirectory
> pom.xml (put your modules etc)
> /ParentProjDirectory/Child#1ProjDirectory
> pom.xml (put a reference to the parent project)
> /ParentProjDirectory/Child#2ProjDirectory
> pom.xml (put a reference to parent project)
> /ParentProjDirectory/Child#3ProjDirectory
> pom.xml (put a reference to the parent project)
>
>
> What I want is the directory structure you outlined below, cos this is
> a lot better from a development perspective, as ppl could just check
> out the bit they are working on, not everything. But so far I haven't
> had a lot mileage on this one.
>
> Can anyone else shed some light here?
>
>
> cheers,
>
>
> paul
>
> On 3/25/06, TJ Greenier <tj...@gmail.com> wrote:
> > Hi all,
> >
> > I used Maven in the past and I am trying to get up to speed with Maven
> 2.0.
> > I have a question regarding multiple projects and was hoping that
> someone
> > can point me in the right directions, as I am getting a little confused.
> >
> > My intentions:
> > I have a project that can be separated as client, server and common code
> > bases.
> > I want to be able to check out each one independently to build and unit
> > test.
> > I also want to be able to build the project as a whole in which I would
> get
> > two resulting archive files (say client.jar and server.war)
> >
> > Currently my project is structured as follows:
> > MyProject
> > - ClientProject
> > - packages....
> > - pom.xml (jar type)
> > - ServerProject
> > - packages....
> > - pom.xml (war type)
> > - CommonProject
> > - packages....
> > - pom.xml (jar type, this project is used by both client and server)
> > - pom.xml
> >
> > The MyProject pom.xml content:
> > <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">
> > <modelVersion>4.0.0</modelVersion>
> > <groupId>com.company.project</groupId>
> > <artifactId>MyProject</artifactId>
> > <version>1.0-SNAPSHOT</version>
> > <packaging>pom</packaging>
> > <name>MyProject</name>
> > <modules>
> > <module>ClientProject</module>
> > <module>ServerProject</module>
> > <module>CommonProject</module>
> > </modules>
> > <dependencies>
> > <dependency>
> > <groupId>junit</groupId>
> > <artifactId>junit</artifactId>
> > <version>3.8.1</version>
> > <scope>test</scope>
> > </dependency>
> > </dependencies>
> > </project>
> >
> > My Issues:
> > I can currently build each project separately, but I am struggling with
> > building the over all project and getting two archives (jar and war).
> > I am open to suggestions if I am going about this the wrong way, but I
> was
> > hoping that someone could point me to an example or link that would help
> me
> > work through this. My thoughts were that the pom packaging would just
> > execute the packaging for each subproject, thus getting me the
> client.jarand
> > server.war files that I need.
> >
> > My project is currently using Ant and has duplicated a lot of what Maven
> can
> > do in a nonstandard manner. I am hoping to use Maven 2.0 to cleanup our
> > build process and remove some of our issues with our current build
> process.
> >
> > Many thanks in advance.
> >
> > T.J. Greenier
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Multiple Project Builds
Posted by Paul Li <pa...@gmail.com>.
Hi TJ,
I have the same problem. if anyone know of an example pom.xml that
would be great!
I remember reading from the maven documentations, that you have to set
the project up in a particular directory structure to get this to
work. Which is no good for me :-(
I recall the directory you need is:
/ParentProjDirectory
pom.xml (put your modules etc)
/ParentProjDirectory/Child#1ProjDirectory
pom.xml (put a reference to the parent project)
/ParentProjDirectory/Child#2ProjDirectory
pom.xml (put a reference to parent project)
/ParentProjDirectory/Child#3ProjDirectory
pom.xml (put a reference to the parent project)
What I want is the directory structure you outlined below, cos this is
a lot better from a development perspective, as ppl could just check
out the bit they are working on, not everything. But so far I haven't
had a lot mileage on this one.
Can anyone else shed some light here?
cheers,
paul
On 3/25/06, TJ Greenier <tj...@gmail.com> wrote:
> Hi all,
>
> I used Maven in the past and I am trying to get up to speed with Maven 2.0.
> I have a question regarding multiple projects and was hoping that someone
> can point me in the right directions, as I am getting a little confused.
>
> My intentions:
> I have a project that can be separated as client, server and common code
> bases.
> I want to be able to check out each one independently to build and unit
> test.
> I also want to be able to build the project as a whole in which I would get
> two resulting archive files (say client.jar and server.war)
>
> Currently my project is structured as follows:
> MyProject
> - ClientProject
> - packages....
> - pom.xml (jar type)
> - ServerProject
> - packages....
> - pom.xml (war type)
> - CommonProject
> - packages....
> - pom.xml (jar type, this project is used by both client and server)
> - pom.xml
>
> The MyProject pom.xml content:
> <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">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.company.project</groupId>
> <artifactId>MyProject</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>pom</packaging>
> <name>MyProject</name>
> <modules>
> <module>ClientProject</module>
> <module>ServerProject</module>
> <module>CommonProject</module>
> </modules>
> <dependencies>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>3.8.1</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> </project>
>
> My Issues:
> I can currently build each project separately, but I am struggling with
> building the over all project and getting two archives (jar and war).
> I am open to suggestions if I am going about this the wrong way, but I was
> hoping that someone could point me to an example or link that would help me
> work through this. My thoughts were that the pom packaging would just
> execute the packaging for each subproject, thus getting me the client.jarand
> server.war files that I need.
>
> My project is currently using Ant and has duplicated a lot of what Maven can
> do in a nonstandard manner. I am hoping to use Maven 2.0 to cleanup our
> build process and remove some of our issues with our current build process.
>
> Many thanks in advance.
>
> T.J. Greenier
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org