You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Darren Hartford <dh...@ghsinc.com> on 2003/07/18 17:24:34 UTC
How to not extend maven.xml from parent project to subprojects?
Hey all,
Still loving Maven, thank you thank you thank you!!!!
I came across this scenario, and it tripped me up a bit before finally figuring it out, so sharing it and wondering if there is a better way of handling it. What I have is in my root project folder, the maven.xml has the following pre-goal to create a list of all the subprojects. Attached below is the code snip if anyone is interested.
I got tripped up on this because the pre-goal I defined in my root maven.xml extended/carried over to all my subprojects. This is kinda cool, but I don't want to do that in this scenario (it tries to run the pre-goal from the subproject, which the reactor doesn't like). I suppose I could go into *each* maven.xml file in each of the subprojects and do an overwrite, but that just seems silly. Any ideas? TIA!
-D
===code snip===
<preGoal name="xdoc:transform">
<mkdir dir="xdocs/"/>
<j:file name="xdocs/modules.xml"
prettyPrint="true">
<document>
<properties>
<title>KBMS Modules</title>
<author email="dhartford@ghsinc.com">Darren Hartford</author>
</properties>
<body>
<section name="Module Listing">
<p>
The following are the modules that make up KBMS.
</p>
<ul>
<maven:reactor
basedir="modules"
includes="*/project.xml"
postProcessing="true"
/>
<j:forEach var="reactorProject" items="${reactorProjects}">
<li>
<a href="../${reactorProject.artifactId}/index.html">${reactorProject.artifactId}</a>
</li>
</j:forEach>
</ul>
</section>
</body>
</document>
</j:file>
</preGoal>
===code snip===
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: How to not extend maven.xml from parent project to subprojects?
Posted by Michal Maczka <mm...@cqs.ch>.
On Fri, 2003-07-18 at 17:24, Darren Hartford wrote:
> Hey all,
> Still loving Maven, thank you thank you thank you!!!!
> I came across this scenario, and it tripped me up a bit before finally figuring it out, so sharing it and wondering if there is a better way of handling it. What I have is in my root project folder, the maven.xml has the following pre-goal to create a list of all the subprojects. Attached below is the code snip if anyone is interested.
>
> I got tripped up on this because the pre-goal I defined in my root maven.xml extended/carried over to all my subprojects. This is kinda cool, but I don't want to do that in this scenario (it tries to run the pre-goal from the subproject, which the reactor doesn't like). I suppose I could go into *each* maven.xml file in each of the subprojects and do an overwrite, but that just seems silly. Any ideas? TIA!
> -D
>
I think that the best is to have two distinct projects:
foo-shared (all "normal" subproject inheriting from this project)
foo-aggregator (this project is used to perform reactor-powered builds
which are aggregating results e.g. handling generation of sites for all
of subprojects)
Michal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org