The way I handle it is to create a unique goal in your root project which has one attainGoal tag that uses the preGoal on the new unique goal.

ex:

<goal name="xdocwrapper">
   <attainGoal name="xdoc:transform">
</goal>

<preGoal name="xdocwrapper">
    <mkdir dir="xdocs/"/>
    <j:file name="xdocs/modules.xml">
    .....
</preGoal>



From: "Darren Hartford" <[EMAIL PROTECTED]>
Reply-To: "Maven Users List" <[EMAIL PROTECTED]>
To: "Maven Users List" <[EMAIL PROTECTED]>
Subject: How to not extend maven.xml from parent project to subprojects?
Date: Fri, 18 Jul 2003 11:24:34 -0400

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="[EMAIL PROTECTED]">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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to