You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wendy Smoak <ws...@gmail.com> on 2005/11/20 03:22:17 UTC

[m2] parent poms and svn externals

Struts uses svn externals to place /struts/build/trunk under each
other sub-project, such as core.  (Then a 'current' external to make
it possible to check out all the sub-projects at once.)

The result is a structure like this:
/current/build
/current/core
/current/core/build

Where those two build directories contain the exact same files.

With m1 and the reactor, you could run from current/build/ using

maven.multiproject.basedir  = ../
maven.multiproject.includes = */project.xml
maven.multiproject.excludes = build/*

   and

  	<maven:reactor
	      basedir="../"
	      includes="*/project.xml"
	      excludes="build/project.xml"
	      goals="dist" />

Then each of the project.xml files extends the project.xml *below* it
in the svn external build directory:

  <extend>build/project.xml</extend>

In m2 it seems I can't have it both ways... build from the top and
extend beneath using the same parent pom in multiple places.

The goal is to be able to check out and build a single sub-project.

I'll spare you my wild guesses at how to make this work and just ask
for advice.  Can it be done, or will the sub-project poms have to
<extend>../build/pom.xml</extend> ?  (Or should it be done some other
way?)

Thanks,
--
Wendy

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


Re: [m2] parent poms and svn externals

Posted by Brett Porter <br...@gmail.com>.
This doesn't appear relative to the parent element.

- Brett

On 11/21/05, Jeff Jensen <je...@upstairstechnology.com> wrote:
> This issue has notes relevant to you too (for one, it must be absolute path;
> for two, I'm not sure, but it seems they plan to get rid of the feature).
> Please comment and vote...
>
> http://jira.codehaus.org/browse/MNG-1471
>
>
> -----Original Message-----
> From: Wendy Smoak [mailto:wsmoak@gmail.com]
> Sent: Sunday, November 20, 2005 12:31 PM
> To: Maven Users List
> Subject: Re: [m2] parent poms and svn externals
>
> On 11/20/05, Brett Porter <br...@gmail.com> wrote:
> > Right - though Maven discovers pom's in ../pom.xml, so if your layout
> > is different, you must ensure that the parent is already installed in
> > the repository (mvn install in the build directory in this case, or
> > deployed to a remote repository accessible from the child project).
>
> Right now (with m1) we can check out a single subproject and build it with
> just 'svn co ...' and 'maven dist'.
>
> It seems like we're going to lose that with m2.  So far I think the <parent>
> tag has to include <relativePath>../build/pom.xml</relativePath> (and
> everyone will need to know to check out 'build' along with whichever
> sub-project).  And the svn externals are no longer useful.
>
> That's okay... but before I go down that path I want to make sure I'm not
> missing something that will make it Just Work with m2.
>
> Thanks,
> --
> Wendy
>
> ---------------------------------------------------------------------
> 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
>
>

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


Re: [m2] parent poms and svn externals

Posted by Brett Porter <br...@gmail.com>.
You've got this corect - the modules are path based (in hindisght,
maybe they should be repository references too - we'll look at
implementing that in a backwards compatible way in 2.1).

- Brett

On 11/21/05, Wendy Smoak <ws...@gmail.com> wrote:
> On 11/20/05, Brett Porter <br...@gmail.com> wrote:
>
> > No, that's not the case. Someone just needs to deploy that root project.
> >
> > Relative path is just a hint for using a multiproject checkout
> > structure so that if you edit it locally it gets picked up. It still
> > goes to the repository if it is not found.
>
> Okay, that will allow each child to find its parent.  But how does the
> parent find the children?
>
> If I have
> current/build/pom.xml
> current/core/pom.xml
> current/taglib/pom.xml
>
> Then what do I put in the <module> tags in current/build/pom.xml?
>    <module>../core</module>
>    <module>../taglib</module>
> ?
>
> In addition to being able to build a single sub-project, I also need
> to be able to build all of them at once.
>
> Thanks for your patience. :)
> --
> Wendy
>
> ---------------------------------------------------------------------
> 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: [m2] parent poms and svn externals

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/20/05, Brett Porter <br...@gmail.com> wrote:

> No, that's not the case. Someone just needs to deploy that root project.
>
> Relative path is just a hint for using a multiproject checkout
> structure so that if you edit it locally it gets picked up. It still
> goes to the repository if it is not found.

Okay, that will allow each child to find its parent.  But how does the
parent find the children?

If I have
current/build/pom.xml
current/core/pom.xml
current/taglib/pom.xml

Then what do I put in the <module> tags in current/build/pom.xml?
   <module>../core</module>
   <module>../taglib</module>
?

In addition to being able to build a single sub-project, I also need
to be able to build all of them at once.

Thanks for your patience. :)
--
Wendy

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


Re: [m2] parent poms and svn externals

Posted by Brett Porter <br...@gmail.com>.
On 11/21/05, Wendy Smoak <ws...@gmail.com> wrote:
> It seems like we're going to lose that with m2.  So far I think the
> <parent> tag has to include
> <relativePath>../build/pom.xml</relativePath> (and everyone will need
> to know to check out 'build' along with whichever sub-project).  And
> the svn externals are no longer useful.

No, that's not the case. Someone just needs to deploy that root project.

Relative path is just a hint for using a multiproject checkout
structure so that if you edit it locally it gets picked up. It still
goes to the repository if it is not found.

- Brett

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


RE: [m2] parent poms and svn externals

Posted by Jeff Jensen <je...@upstairstechnology.com>.
This issue has notes relevant to you too (for one, it must be absolute path;
for two, I'm not sure, but it seems they plan to get rid of the feature).
Please comment and vote...

http://jira.codehaus.org/browse/MNG-1471


-----Original Message-----
From: Wendy Smoak [mailto:wsmoak@gmail.com] 
Sent: Sunday, November 20, 2005 12:31 PM
To: Maven Users List
Subject: Re: [m2] parent poms and svn externals

On 11/20/05, Brett Porter <br...@gmail.com> wrote:
> Right - though Maven discovers pom's in ../pom.xml, so if your layout 
> is different, you must ensure that the parent is already installed in 
> the repository (mvn install in the build directory in this case, or 
> deployed to a remote repository accessible from the child project).

Right now (with m1) we can check out a single subproject and build it with
just 'svn co ...' and 'maven dist'.

It seems like we're going to lose that with m2.  So far I think the <parent>
tag has to include <relativePath>../build/pom.xml</relativePath> (and
everyone will need to know to check out 'build' along with whichever
sub-project).  And the svn externals are no longer useful.

That's okay... but before I go down that path I want to make sure I'm not
missing something that will make it Just Work with m2.

Thanks,
--
Wendy

---------------------------------------------------------------------
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: [m2] parent poms and svn externals

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/20/05, Brett Porter <br...@gmail.com> wrote:
> Right - though Maven discovers pom's in ../pom.xml, so if your layout
> is different, you must ensure that the parent is already installed in
> the repository (mvn install in the build directory in this case, or
> deployed to a remote repository accessible from the child project).

Right now (with m1) we can check out a single subproject and build it
with just 'svn co ...' and 'maven dist'.

It seems like we're going to lose that with m2.  So far I think the
<parent> tag has to include
<relativePath>../build/pom.xml</relativePath> (and everyone will need
to know to check out 'build' along with whichever sub-project).  And
the svn externals are no longer useful.

That's okay... but before I go down that path I want to make sure I'm
not missing something that will make it Just Work with m2.

Thanks,
--
Wendy

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


Re: [m2] parent poms and svn externals

Posted by Brett Porter <br...@gmail.com>.
Right - though Maven discovers pom's in ../pom.xml, so if your layout
is different, you must ensure that the parent is already installed in
the repository (mvn install in the build directory in this case, or
deployed to a remote repository accessible from the child project).

- Brett

On 11/20/05, Stephen Duncan <st...@gmail.com> wrote:
> Child projects specify their parent POM using the <parent> tag instead
> of <extends>.  A parent tag looks like this:
>
> <parent>
>    <groupId>com.myproject</groupId>
>    <artifactId>myproject</artifactId>
>    <version>1.3-SNAPSHOT</version>
> </parent>
>
> The parent POM is looked for in the repository, so, in your source
> structure, it can exist anywhere.
>
> -Stephen
>
>
> On 11/19/05, Wendy Smoak <ws...@gmail.com> wrote:
> > Struts uses svn externals to place /struts/build/trunk under each
> > other sub-project, such as core.  (Then a 'current' external to make
> > it possible to check out all the sub-projects at once.)
> >
> > The result is a structure like this:
> > /current/build
> > /current/core
> > /current/core/build
> >
> > Where those two build directories contain the exact same files.
> >
> > With m1 and the reactor, you could run from current/build/ using
> >
> > maven.multiproject.basedir  = ../
> > maven.multiproject.includes = */project.xml
> > maven.multiproject.excludes = build/*
> >
> >    and
> >
> >         <maven:reactor
> >               basedir="../"
> >               includes="*/project.xml"
> >               excludes="build/project.xml"
> >               goals="dist" />
> >
> > Then each of the project.xml files extends the project.xml *below* it
> > in the svn external build directory:
> >
> >   <extend>build/project.xml</extend>
> >
> > In m2 it seems I can't have it both ways... build from the top and
> > extend beneath using the same parent pom in multiple places.
> >
> > The goal is to be able to check out and build a single sub-project.
> >
> > I'll spare you my wild guesses at how to make this work and just ask
> > for advice.  Can it be done, or will the sub-project poms have to
> > <extend>../build/pom.xml</extend> ?  (Or should it be done some other
> > way?)
> >
> > Thanks,
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Stephen Duncan Jr
> www.stephenduncanjr.com
>
> ---------------------------------------------------------------------
> 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: [m2] parent poms and svn externals

Posted by Stephen Duncan <st...@gmail.com>.
Child projects specify their parent POM using the <parent> tag instead
of <extends>.  A parent tag looks like this:

<parent>
   <groupId>com.myproject</groupId>
   <artifactId>myproject</artifactId>
   <version>1.3-SNAPSHOT</version>
</parent>

The parent POM is looked for in the repository, so, in your source
structure, it can exist anywhere.

-Stephen


On 11/19/05, Wendy Smoak <ws...@gmail.com> wrote:
> Struts uses svn externals to place /struts/build/trunk under each
> other sub-project, such as core.  (Then a 'current' external to make
> it possible to check out all the sub-projects at once.)
>
> The result is a structure like this:
> /current/build
> /current/core
> /current/core/build
>
> Where those two build directories contain the exact same files.
>
> With m1 and the reactor, you could run from current/build/ using
>
> maven.multiproject.basedir  = ../
> maven.multiproject.includes = */project.xml
> maven.multiproject.excludes = build/*
>
>    and
>
>         <maven:reactor
>               basedir="../"
>               includes="*/project.xml"
>               excludes="build/project.xml"
>               goals="dist" />
>
> Then each of the project.xml files extends the project.xml *below* it
> in the svn external build directory:
>
>   <extend>build/project.xml</extend>
>
> In m2 it seems I can't have it both ways... build from the top and
> extend beneath using the same parent pom in multiple places.
>
> The goal is to be able to check out and build a single sub-project.
>
> I'll spare you my wild guesses at how to make this work and just ask
> for advice.  Can it be done, or will the sub-project poms have to
> <extend>../build/pom.xml</extend> ?  (Or should it be done some other
> way?)
>
> Thanks,
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
Stephen Duncan Jr
www.stephenduncanjr.com

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