See inline
On 10/09/2011 07:17 PM, Steve Cohen wrote:
Thanks, Rafał.
Why do you say it's less hassle the flat way? Is that because of version
control, or what?
It's just the way Eclipse does things, and you don't need to deal with
things showing up multiple time in search and team/synchronize views.
When you say, "Maven's native layout" what does that mean? Is there some
particular archetype that creates it for you that way, or what?
If you look at the sources of Maven itself, or other software created by
the people behind maven, you'll find that module hierarchy corresponds to
directory nesting.
Historically, some maven plugins (most notably release and site plugins)
made assumptions about the physical layout of modules and didn't work
properly with flat layout. Recent versions of release plugin can work with
both, I don't know about site plugin because I haven't used it for many
years, but I suspect that it was taken care of too.
I wound up taking a few hours of frantically trying this and trying that,
coming up with something that worked, without fully understanding what I was
doing (I suspect I was taking advantage of Eclipse functionality that might
not be repeatable outside of Eclipse) and wound up with a layout in between
your Eclipse and Maven models (everything flat under the parent - only 1
level of nesting):
-parent pom
-ear
-war 1
-war 2
-utilty jar 1
I'd really like to come up with a standard methodology that works and that
I understand, so thanks for your help. It bothers me that I don't fully
understand what I just did.
This layout can be converted into completely flat layout easily. You need
to modify the children POMs to reference the parent POM like this:
<parent>
<relativePath>../parent pom</relativePath>
</parent>
And modify the modules section of the parent POM acordingly:
<modules>
<module>../ear</module>
...
</module>
At some point maybe even convert the methodology into an archetype that
would be repeatable, but that is currently beyond my skill set. I have no
idea how archetypes are created.
You start with capturing an existing module structure: