[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Maven & Repository Layout

From: Benjamin Smith-Mannschott <bsmith.occs_at_gmail.com>
Date: Wed, 30 Jul 2008 20:35:21 +0200

On Jul 29, 2008, at 18:52, Mina R Waheeb wrote:
>
> There is another methodology to create a flat structure for all the
> system components and use the idea of svn:externals to link em all as
> described below.
>
> |--- REPO
> |---- comp1.sub.component1
> |---- comp2.sub2.component1
> |---- branches/
> |---- tags/
> |---- trunk/
> |---- pom.xml
> |---- src
> |---- project ()
> |---- pom.xml (Maven project descriptor)
> |---- component 1 (external link to REPO/
> comp2.sub2.component1/trunk)

Go flat, if you can.

repo:
     project/
         trunk/
             pom.xml
         tags/
         branches/
     component1/
         trunk/
             pom.xml
             src
         tags/
         branches/
     component2/
         trunk/
             pom.xml
         tags/
         branches/
     component2.sub1/
         trunk/
             pom.xml
         tags/
         branches/
     component2.sub1.sub
         trunk/
             pom.xml
             src
         tags/
         branches/

In this way, each maven project becomes its own little repository. I
find keeping the structure flat like this simplifies a number of
things. It also works better than nested projects when used with a
combination of m2eclipse + subclipse.

The problem, of course, is that you'll want to be able to refer form
parent poms to their children since it looks like you're doing
multi-module builds. You can use relative paths to your sub-modules:

component2.sub1/pom.xml :
   ...
   <modules>
    <module>../component2.sub1.sub
    ...
   </modules>
   ...

Now that means that you've got to get all your checkouts as siblings.
You could solve this by either scripting the checkout:

for p in project component1 component2 component2.sub1 \
          component2.sub1.sub
do
         svn co svn://repo/$p/trunk $p
done

Or, you could establish a special class of multi-module checkout
folders using svn externals.

repo:
     ...
     buildbranches/ +---------------+
         trunk <--- | svn:externals |
                  +----------------------------------------------------+
                  | project svn://repo/project/trunk |
                  | component1 svn://repo/component1/trunk |
                  | ... |
                  | component2.sub1.sub svn://repo/component2.sub1.sub |
                  +----------------------------------------------------+

When you pull a logical branch across multiple components, it will
result in one svn branch in for each of the components. (These
branches will just all have the same name.) You could use a
buildbranch to pull these together to make it easier to check them out
together.

Anyway, those are my thoughts. This is how I would do it. In fact,
this is how I am doing it. Though I hasten to add that I'm still a
relative beginner in trying to make maven + subclipse + m2eclipse play
nice at the office.

// Ben

  
             

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-07-31 09:55:14 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.