I'm having a Maven problem I can't quite figure out. It has eluded all my
usual Maven troubleshooting techniques.
This is all under beta-10.
Setup: A multiproject web application. Because the default multiproject
plugin does some things we don't like (and is semi-broken in beta-10 anyway)
we defined our own build goal. Actually, more than a goal, a plugin used for
all of our products. Relevant script code for this plugin follows (though
you might want to blow past it to read the description of the problem
first):
(Note: the project in question, being a multiproject app, has a "modules"
directory, thus all of the test="${hasModules}" lines will be true)
<goal name="tag:build-daily" description="Full daily clean, build and
site generation">
<attainGoal name="tag:clean"/>
<attainGoal name="tag:build"/>
<attainGoal name="tag:site"/>
</goal>
<goal name="tag:clean" description="Clean that detects multiproject
builds">
<ant:available file="modules" type="dir" property="hasModules"/>
<j:if test="${hasModules}">
<j:set var="goal" scope="parent" value="clean:clean"/>
<attainGoal name="multiproject:goal"/>
</j:if>
<attainGoal name="clean:clean"/>
</goal>
<goal name="tag:build" description="Invoke tag.build.goal on all
subprojects.">
<ant:available file="modules" type="dir" property="hasModules"/>
<j:choose>
<j:when test="${hasModules}">
<j:set var="goal" scope="parent" value="tag:build-callback"/>
<attainGoal name="multiproject:goal"/>
</j:when>
<j:otherwise>
<attainGoal name="${tag.build.goal}"/>
</j:otherwise>
</j:choose>
</goal>
<goal name="tag:build-callback">
<attainGoal name="${tag.build.goal}"/>
</goal>
<goal name="tag:site" description="Site generation that detects
multiproject builds">
<property name="maven.docs.dest" value="${maven.build.dir}/docs"/>
<ant:mkdir dir="${maven.docs.dest}"/>
<ant:available file="modules" type="dir" property="hasModules"/>
<j:if test="${hasModules}">
<!-- Do something .close. to what multiproject:site does, but
without
overwriting the index files. And without cleaning. -->
<maven:reactor
basedir="."
includes="**/project.xml"
excludes="${maven.multiproject.excludes}"
postProcessing="true"
goals="site:generate"
ignoreFailures="false"
/>
</j:if>
<attainGoal name="site:generate"/>
<j:if test="${hasModules}">
<!-- copy each project over into ${maven.docs.dest} -->
<j:forEach var="reactorProject" items="${reactorProjects}">
<j:set var="directory"
value="${maven.docs.dest}/${reactorProject.artifactId}"/>
<mkdir dir="${directory}"/>
<!--
${reactorProject.name} has docs directory
${reactorProject.getPluginContext('maven-xdoc-plugin').getVariable('maven.do
cs.dest')}
needing to be copied
-->
<j:set var="fromDir"
value="${reactorProject.getPluginContext('maven-xdoc-plugin').getVariable('m
aven.docs.dest')}"/>
<ant:move toDir="${directory}">
<fileset dir="${fromDir}"/>
</ant:move>
</j:forEach>
</j:if>
</goal>
Problem: When running tag:build-daily, everything works great until the
invocation of tag:site. When running that, the reactor starts, and on the
first subprojects returns this error almost immediately:
Unable to obtain goal [site] -- file:/C:/Documents and
Settings/Build/.maven/plugins/maven-site-plugin-1.2/:24:42: <attainGoal>
Goal [xdoc:register-reports] has no action definition.
Now, HERE IS THE WEIRD PART: if I run tag:site by itself (not as an
attainGoal from within tag:build-daily) it works perfectly. It seems to me
there should be no difference between these two situations.
Any ideas?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]