This is interesting!

The example you pointed to indicates in the section
http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance_vs_Project_Aggregation
that the <parent> project can serve for refactoring out common configurations
and settings.  It also says you can have a multi-module project (which it also
calls a "parent" project - but I think this is quite confusing, and prefer to
use the term "aggregation" or multi-module project) which specifies the modules
to be built together.

It then says that these two POMs, "can" be the same, which is not the same of
course as saying they *must* be the same.


This reference (from the Maven - the Complete Reference book),
http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-pom-best-practice.html#pom-relationships-sect-multi-vs-inherit

shows a counter example, where these two POMs are not the same: see 3.6.2.1
Simple Project.

Here, they are using a pom to do "aggregation" for multi-submodules, and each of
those submodules does *not* have that aggregation POM as its parent.

The documentation seems to clearly distinguish "parent-poms" referred to using
the <parent> element in another pom  -- used for "factoring out" common things
shared by may child poms -- from "aggregation" or "multimodule project" -
specifying what a build should include.

So, this is how we have structured things.  The <parent> element refers to poms
that are holding common factored-out settings, while the pom we use for
building/releasing, is just one that gathers all the different submodules
together.  We don't make these the same, because different submodules have
different parents (because different kinds of submodules have differing common
parts factored out into the parent).
 
As I've said previously, the other parts of Maven operation (building,
installing, etc.) seem to work just fine with this setup.

Are you saying that the Maven Release plugin, in particular, has the restriction
that in order for it to work, it the multimodule project has to be the parent?

-Marshall Schor

On 9/24/2010 2:24 PM, Antonio Petrelli wrote:
> 2010/9/24 Marshall Schor <[email protected]>:
>> On 9/24/2010 2:08 PM, Antonio Petrelli wrote:
>>> 2010/9/24 Marshall Schor <[email protected]>:
>>>> The top pom and all the poms in the submodules have version numbers 
>>>> 2.3.1-SNAPSHOT.
>>>> The top pom has *some* of the submodules also listed as <dependencies>, 
>>>> with the
>>>> 2.3.1-SNAPSHOT version.
>>> This does not make any sense, this is a circular dependency,
>> Can you please help explain where the "circularity" comes in?  Are you 
>> assuming
>> that the sub-modules have a reference to the top pom?  (Maybe you assumed 
>> they
>> used the top pom as a parent? - but they don't).
> They don't? It's wrong then:
> http://docs.codehaus.org/display/MAVENUSER/Multi-modules+projects
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to