You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by kapilanand <an...@yahoo.com> on 2007/07/24 18:02:06 UTC

Re: [m2] Parent POM and dependencies

hi Jim
I think I understand what you are saying and I have been in the same boat,
though in a different aspect.
Here's is what I understand about this, and my feeling is that current
support of inheritance and aggregation do not complement each other.

Project type pom can be used for two purposes:

1) Parent pom for "Inherited children":
Define a base project that all inherited children can refer to. Define all
common dependencies, repositories, distributionManagement etc in this parent
pom, but do not define its dependency on children. In other words if you
look closely from object-orientation perspective, base class cannot be aware
of the children or specialized classes. Only exception to this is the
dependencyManagement section which tries to glue and control the versions of
participating child projects.

2) Parent for "Contained children":
Define a pom project that defines multiple module it is supposed to
compile/contain. Or if you do not want this whole-aggregates relationship,
do not define modules and just define dependency on all "contained children"
projects. This way another project could just add this aggregating pom
project as dependency and will end up including all its dependencies.

Hope my response made some sense, though i am not very satisfied after
writing it.

- kapil


Jim-53 wrote:
> 
> Thanks John,
> 
> In this case I could use some help understanding. In every case, without 
> exception, when I add a "dependencies" section of a POM file whose 
> packaging is "pom," not once have I intended that POM files artifact to 
> be what is dependent on those items. In every case it's the children of 
> that POM file that I want to "include" those dependencies.
> 
> I cannot even envision a case where a dependency listed in a POM file 
> whose packaging is POM is actually a dependency on the building of the 
> POM artifact.
> 
> If possible some clarification would be much appreciated.
> 
> Thanks,
> Jim
> 
> John Tolentino wrote:
> 
>> Hi Jim,
>>
>> All POMs' dependencies needs to be validated regardless of its packaging.
>>
>> Regards,
>> John
>>
>> Jim Carroll wrote:
>>
>>>
>>> It appears that the transitive dependency mechanism is not sensitive 
>>> to the packaging. This seems odd to me and is causing me an 
>>> incredible amount of grief. I have a parent pom that defines a 
>>> dependency. I intend this parent pom to be used almost like an 
>>> "include." For example:
>>>
>>> <project>
>>>  <modelVersion>4.0.0</modelVersion>
>>>  <groupId>mycompany.poms</groupId>
>>>  <artifactId>parentpom</artifactId>
>>>  <version>xxx</version>
>>>  <packaging>pom</packaging>
>>> ....
>>>  <dependencies>
>>>    <dependency>
>>>      <groupId>mycompany.lib</groupId>
>>>      <artifactId>utility</artifactId>
>>>      <version>xxx</version>
>>>    </dependency>
>>>  </dependencies>
>>> ....
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-m2--Parent-POM-and-dependencies-tf1189144s177.html#a11766341
Sent from the Maven - Users mailing list archive at Nabble.com.


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