Kenney,

Thanks for your reply. I am still a bit puzzled though when SCM is brought
into the picture.

Is the following hypothesis correct?

- Setup the recommended M2 structure for multiple modules.

- Generate an Eclipse project + class path per module by running the Eclipse
plugin from the root of this structure.

- Check in the entire tree as a single SCM module.

- To work on an individual module: Check out the subsection of the structure
that holds the module and Eclipse project for that module.

- To build the entire application: Check out the entire SCM module and run
the build from the structure's root.

Thanks

Thomas


On 9/30/05, Kenney Westerhof <[EMAIL PROTECTED]> wrote:
>
> On Fri, 30 Sep 2005, Thomas Van de Velde wrote:
>
> Hi,
>
> > I ment to send this to the users list. Sorry for the double post!
> >
> > Cheers,
> > Thomas
> >
> > On 9/30/05, Thomas Van de Velde <[EMAIL PROTECTED]>
> wrote:
> > >
> > > Hi,
> > >
> > > I am wondering what the best way is to setup a project layout with M2
> and
> > > Eclipse for multiple modules. The documentation<
> http://maven.apache.org/maven2/getting-started.html>recommends the
> following:
> > >
> > > +- pom.xml
> > > +- my-app
> > > | +- pom.xml
> > > +- my-webapp
> > > | +- pom.xml
>
> Yes, this is the recommended way. The topmost pom.xml is the parent pom,
> containing <module> sections for subdirectories.
>
> > > The only way I can see this work with Eclipse is to add the entire
> > > structure to a single Eclipse project. However this is not something
> I'd
> > > want to do because I don't want to have a single Eclipse classpath
> that is
> > > exposed to my-app and my-webapp.
>
> Why? Separate projects work fine. It's just nested non-pom projects that
> don't work well in eclipse.
>
> > > The only way around this, that I can currently see, is to do this:
>
> I don't see a problem..
>
> > > +- my-master
> > > | +- pom.xml
> > > +- my-app
> > > | +- pom.xml
> > > +- my-webapp
> > > | +- pom.xml
>
> You're still missing the parent pom that defies my-master, my-app and
> my-webapp as modules.
>
> > > In this scenario; my-master, my-app, and my-webapp are all seperate
> > > Eclipse projects. To make this work, I need to change the master POM's
> > > modules element to the following:
> > > <modules>
> > > <module>../my-app</module>
> > > <module>../my-webapp</module>
> > > </modules>
>
> You don't, you just need to specify dependencies from my-webapp and
> my-app to my-master.
>
> Modules are normally located UNDER the project that defines them.
> The project that defines them usually has packaging 'pom'.
> So the only projects that produce artifacts tend to be leaf projects
> (no nested modules). Maven2 doesn't require this at all, but if
> you want to have in-place eclipse .project/.classpath this is recommended.
>
> If, in the maven2 recommended structure (the first one you mentioned),
> the root pom would produce an artifact, eclipse would break. What you
> can do in that case is run m2 eclipse:eclipse
> -Declipse.workspace=some/other/location; the plugin then creates a
> flattened project structure to overcome eclipse's nesting limitation.
>
> Also, never ever join all your subprojects in one eclipse project!
> That will require adding dependencies manually, and will break the
> separation of classpaths. Your code might end up requiring circular
> dependencies, breaking an m2 build.
>
> > > Have I missed something or is this the recommended way?
>
> Hope the above answers your question?
>
> -- Kenney
>
> > >
> > > Thanks!
> > >
> > > Thomas
> > >
> >
>
> --
> Kenney Westerhof
> http://www.neonics.com
> GPG public key: http://www.gods.nl/~forge/kenneyw.key
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to