git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113620 13f79535-47bb-0310-9956-ffa450edef68
196 lines
7.5 KiB
XML
196 lines
7.5 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<project
|
|
xmlns:j="jelly:core"
|
|
xmlns:m="maven"
|
|
xmlns:maven="jelly:maven"
|
|
xmlns:ant="jelly:ant"
|
|
xmlns:doc="doc"
|
|
xmlns:util="jelly:util"
|
|
xmlns:velocity="jelly:velocity">
|
|
|
|
<j:set var="maven.gen.docs"
|
|
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}"/>
|
|
<j:set var="maven.docs.dest"
|
|
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}"/>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Default goal: builds sites for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject"
|
|
description="Run the site goal of all subprojects"
|
|
prereqs="multiproject:site">
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Builds sites for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:site"
|
|
description="Run the site goal of all subprojects">
|
|
|
|
<attainGoal name="multiproject:create-nav"/>
|
|
|
|
<!-- generate site docs -->
|
|
<j:set var="goal" value="clean,site" />
|
|
<attainGoal name="multiproject:goal" />
|
|
|
|
<attainGoal name="site" />
|
|
|
|
<!-- copy or not? -->
|
|
<j:set var="navType" value="${maven.multiproject.navigation}"/>
|
|
<j:if test="${navType == 'aggregate'}">
|
|
<!-- copy each project over into ${maven.docs.dest} -->
|
|
<j:forEach var="reactorProject" items="${reactorProjects}">
|
|
<!-- note this is the same name as is generated in the navigation-aggregate.xml -->
|
|
<j:set var="directory" value="${maven.docs.dest}/multiproject/${reactorProject.name}"/>
|
|
<mkdir dir="${directory}"/>
|
|
<!--
|
|
${reactorProject.name} has docs directory
|
|
${reactorProject.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}
|
|
needing to be copied
|
|
-->
|
|
<j:set var="fromDir"
|
|
value="${reactorProject.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}"/>
|
|
<copy toDir="${directory}">
|
|
<fileset dir="${fromDir}"/>
|
|
</copy>
|
|
</j:forEach>
|
|
</j:if>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Generate HTML files for navigation bar across projects. -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:create-nav">
|
|
<mkdir dir="${maven.gen.docs}"/>
|
|
<!-- get all projects for template processing -->
|
|
<maven:reactor
|
|
basedir="${maven.multiproject.basedir}"
|
|
includes="${maven.multiproject.includes}"
|
|
excludes="${maven.multiproject.excludes}"
|
|
postProcessing="true"
|
|
ignoreFailures="true"
|
|
/>
|
|
|
|
<!-- generate navbar for project based on aggregate or independent -->
|
|
<j:set var="navType" value="${maven.multiproject.navigation}"/>
|
|
<j:if test="${navType != ''}">
|
|
<echo>Producing ${navType} navigation...</echo>
|
|
<velocity:merge
|
|
name="${maven.gen.docs}/navigation.xml"
|
|
basedir="${plugin.resources}/templates"
|
|
template="navigation-${navType}.xml"/>
|
|
</j:if>
|
|
|
|
<util:file var="userNavTemplate" name="${basedir}/multiproject/navigation.xml"/>
|
|
<j:if test="${userNavTemplate.exists()}">
|
|
<echo>Producing user supplied navigation...</echo>
|
|
|
|
<velocity:merge
|
|
name="${maven.gen.docs}/navigation.xml"
|
|
basedir="${basedir}/multiproject"
|
|
template="navigation.xml"/>
|
|
</j:if>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Run specific sets of goals for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:goal" description="Run a given goal on all projects">
|
|
<m:param-check value="${goal}" fail="true">
|
|
A goal to run must be specified, e.g.
|
|
maven -Dgoal=clean multiproject:goal</m:param-check>
|
|
|
|
<ant:echo>Executing ${goal} on all projects</ant:echo>
|
|
<maven:reactor
|
|
basedir="${maven.multiproject.basedir}"
|
|
includes="${maven.multiproject.includes}"
|
|
excludes="${maven.multiproject.excludes}"
|
|
postProcessing="false"
|
|
goals="${goal}"
|
|
ignoreFailures="${maven.multiproject.ignoreFailures}"
|
|
/>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Builds all artifacts for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:artifact"
|
|
description=" Builds all artifacts for all subproject">
|
|
|
|
<!-- fixme: use multiproject:goal here -->
|
|
<maven:reactor
|
|
basedir="${maven.multiproject.basedir}"
|
|
includes="${maven.multiproject.includes}"
|
|
excludes="${maven.multiproject.excludes}"
|
|
postProcessing="false"
|
|
goals="multiproject:artifact-callback"
|
|
ignoreFailures="${maven.multiproject.ignoreFailures}"
|
|
/>
|
|
</goal>
|
|
|
|
<goal name="multiproject:artifact-callback">
|
|
<attainGoal name="${maven.multiproject.type}:${maven.multiproject.type}"/>
|
|
</goal>
|
|
|
|
|
|
<!--==================================================================-->
|
|
<!-- Run 'artifact':install for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:install"
|
|
description="Run 'artifact':install for all subprojects">
|
|
|
|
<j:set var="goal" name="multiproject:install-callback"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
</goal>
|
|
|
|
<goal name="multiproject:install-callback">
|
|
<attainGoal name="${maven.multiproject.type}:install"/>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Run 'artifact':install-snapshot for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:install-snapshot"
|
|
description="Run 'artifact':install-snapshot for all subprojects">
|
|
|
|
<j:set var="goal" name="multiproject:install-snapshot-callback"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
</goal>
|
|
|
|
<goal name="multiproject:install-snapshot-callback">
|
|
<attainGoal name="${maven.multiproject.type}:install-snapshot"/>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Run 'artifact':deploy for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:deploy"
|
|
description="Run 'artifact':deploy for all subprojects">
|
|
|
|
<j:set var="goal" name="multiproject:deploy-callback"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
</goal>
|
|
|
|
<goal name="multiproject:deploy-callback">
|
|
<attainGoal name="${maven.multiproject.type}:deploy"/>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Run 'artifact':deploy-snapshot for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:deploy-snapshot"
|
|
description="Run 'artifact':deploy-snapshot for all subprojects">
|
|
|
|
<j:set var="goal" name="multiproject:deploy-snapshot-callback"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
</goal>
|
|
|
|
<goal name="multiproject:deploy-snapshot-callback">
|
|
<attainGoal name="${maven.multiproject.type}:deploy-snapshot"/>
|
|
</goal>
|
|
|
|
</project>
|