git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@295002 13f79535-47bb-0310-9956-ffa450edef68
405 lines
16 KiB
XML
405 lines
16 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<!--
|
|
/*
|
|
* Copyright 2001-2004 The Apache Software Foundation.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
-->
|
|
|
|
<project
|
|
xmlns:j="jelly:core"
|
|
xmlns:define="jelly:define"
|
|
xmlns:maven="jelly:maven"
|
|
xmlns:ant="jelly:ant"
|
|
xmlns:doc="doc"
|
|
xmlns:util="jelly:util"
|
|
xmlns:velocity="jelly:velocity">
|
|
|
|
<define:taglib uri="multiproject">
|
|
<define:tag name="dependency-handle">
|
|
<!-- this page left intentionally blank -->
|
|
<echo>DEPRECATED: the use of dependency-handle is deprecated. Please use maven:get/set to modify properties of the multiproject plugin</echo>
|
|
</define:tag>
|
|
</define:taglib>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Default goal: builds sites for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject"
|
|
description="Run the site goal of all subprojects and generate overview page"
|
|
prereqs="multiproject:site">
|
|
</goal>
|
|
|
|
<!--======================================================================-->
|
|
<!-- Runs reactor and puts variable "multiprojects" into jelly context. -->
|
|
<!-- This allows to share the work done by reactor in goals -->
|
|
<!-- which just need the list of project but don't need to run any goal -->
|
|
<!--======================================================================-->
|
|
<goal name="multiproject:projects-init">
|
|
<j:if test="${mpprojectsInit == null}">
|
|
<j:set var="mpprojectsInit" value="true" />
|
|
<ant:echo>Gathering project list</ant:echo>
|
|
<maven:reactor
|
|
basedir="${maven.multiproject.basedir}"
|
|
banner="Gathering project list"
|
|
includes="${maven.multiproject.includes}"
|
|
excludes="${maven.multiproject.excludes}"
|
|
postProcessing="true"
|
|
collectOnly="true"
|
|
collectionVar="multiprojects"
|
|
ignoreFailures="${maven.multiproject.ignoreFailures}"
|
|
/>
|
|
</j:if>
|
|
</goal>
|
|
|
|
<!--======================================================================-->
|
|
<!-- Initializations for the multiproject:site goal -->
|
|
<!--======================================================================-->
|
|
<goal name="multiproject:site-init" prereqs="multiproject:projects-init">
|
|
|
|
<j:if test="${mpsiteInit == null}">
|
|
<j:set var="mpsiteInit" value="true" />
|
|
<mkdir dir="${maven.gen.docs}"/>
|
|
|
|
<j:set var="aggregateDir" value="${maven.multiproject.aggregateDir}"/>
|
|
<j:set var="navType" value="${maven.multiproject.navigation}"/>
|
|
<j:set var="overviewPageCreate" value="${maven.multiproject.overviewPage.create}"/>
|
|
<j:set var="overviewPageTitle" value="${maven.multiproject.overviewPage.title}"/>
|
|
<j:set var="overviewPageLink" value="${maven.multiproject.overviewPage.link}"/>
|
|
<j:set var="overviewPageLinkTitle" value="${maven.multiproject.overviewPage.linkTitle}"/>
|
|
<j:set var="overviewPageText" value="${maven.multiproject.overviewPage.text}"/>
|
|
</j:if>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Builds sites for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:site"
|
|
prereqs="multiproject:site-init"
|
|
description="Run the site goal of all subprojects and generate overview page">
|
|
|
|
<!-- copy or not? -->
|
|
<j:set var="navType" value="${maven.multiproject.navigation}"/>
|
|
<j:if test="${navType == 'aggregate'}">
|
|
<!-- generate site docs -->
|
|
<maven:reactor
|
|
basedir="${maven.multiproject.basedir}"
|
|
banner="Generating site for "
|
|
projectList="${multiprojects}"
|
|
goals="${maven.multiproject.site.goals}"
|
|
ignoreFailures="${maven.multiproject.ignoreFailures}"
|
|
/>
|
|
<echo>Now building reactor projects: ${multiprojects}</echo>
|
|
|
|
<!-- copy each project over into ${maven.docs.dest} -->
|
|
<j:forEach var="reactorProject" items="${multiprojects}">
|
|
<!-- note this is the same name as is generated in the navigation-aggregate.xml -->
|
|
<j:set var="directory" value="${maven.docs.dest}/${maven.multiproject.aggregateDir}${reactorProject.artifactId}"/>
|
|
<mkdir dir="${directory}"/>
|
|
<!--
|
|
${reactorProject.name} has docs directory
|
|
${reactorProject.context.getVariable('maven.docs.dest')}
|
|
needing to be copied
|
|
-->
|
|
<j:set var="fromDir"
|
|
value="${reactorProject.context.getVariable('maven.docs.dest')}"/>
|
|
<mkdir dir="${fromDir}"/>
|
|
<copy toDir="${directory}">
|
|
<fileset dir="${fromDir}"/>
|
|
</copy>
|
|
</j:forEach>
|
|
</j:if>
|
|
|
|
<attainGoal name="multiproject:create-nav"/>
|
|
<attainGoal name="multiproject:create-overview-page"/>
|
|
<attainGoal name="site" />
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Generate HTML files for navigation bar across projects. -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:create-nav"
|
|
prereqs="multiproject:site-init">
|
|
|
|
<j:forEach var="reactorProject" items="${multiprojects}">
|
|
<j:if test="${reactorProject.id == pom.id}">
|
|
<fail message="You must exclude ${pom.id} (the top level project) from the subproject set"/>
|
|
</j:if>
|
|
</j:forEach>
|
|
|
|
<!-- generate navbar for project based on aggregate or independent -->
|
|
<j:set var="encoding" value="${maven.docs.outputencoding}"/>
|
|
<j:if test="${navType != ''}">
|
|
<echo>Producing ${navType} navigation...</echo>
|
|
<velocity:merge
|
|
name="${maven.gen.docs}/navigation.xml"
|
|
basedir="${maven.multiproject.templates}"
|
|
template="navigation-${navType}.xml"
|
|
inputEncoding="${encoding}"
|
|
outputEncoding="${encoding}"
|
|
/>
|
|
</j:if>
|
|
|
|
<j:set var="userNav" value="${maven.docs.src}/navigation.xml" />
|
|
|
|
<!-- FIXME: Will the xdoc stuff screw this up?? -->
|
|
<util:file var="userNavTemplate" name="${userNav}"/>
|
|
<j:if test="${userNavTemplate.exists()}">
|
|
<echo>Producing user supplied navigation...</echo>
|
|
|
|
<velocity:merge
|
|
name="${maven.gen.docs}/navigation.xml"
|
|
basedir="${maven.docs.src}"
|
|
template="navigation.xml"
|
|
inputEncoding="${encoding}"
|
|
outputEncoding="${encoding}"
|
|
/>
|
|
</j:if>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Generate Overview of all projects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:create-overview-page"
|
|
prereqs="multiproject:site-init">
|
|
|
|
<j:new var="file" className="java.io.File">
|
|
<j:arg value="${maven.gen.docs}/${overviewPageLink}.xml"/>
|
|
</j:new>
|
|
|
|
<mkdir dir="${file.parent}"/>
|
|
|
|
<j:if test="${overviewPageCreate=='true'}">
|
|
<ant:echo>Creating overview page</ant:echo>
|
|
<j:set var="stylesheetURI" value="file:${plugin.resources}/templates/projects-overview.jelly"/>
|
|
<j:file
|
|
name="${maven.gen.docs}/${overviewPageLink}.xml"
|
|
encoding="${maven.docs.outputencoding}"
|
|
omitXmlDeclaration="false"
|
|
escapeText="false"
|
|
outputMode="xml"
|
|
prettyPrint="true">
|
|
<j:include uri="${stylesheetURI.toString()}"/>
|
|
</j:file>
|
|
</j:if>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Run specific sets of goals for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:goal"
|
|
prereqs="multiproject:projects-init"
|
|
description="Run a given goal on all projects">
|
|
|
|
<j:choose>
|
|
<j:when test="${!empty(internalGoal)}">
|
|
<j:set var="runGoal" value="${internalGoal}"/>
|
|
</j:when>
|
|
<j:otherwise>
|
|
<maven:param-check value="${goal}" fail="true">
|
|
A goal to run must be specified, e.g.
|
|
maven -Dgoal=clean multiproject:goal</maven:param-check>
|
|
<j:set var="runGoal" value="${goal}"/>
|
|
</j:otherwise>
|
|
</j:choose>
|
|
|
|
<maven:reactor
|
|
basedir="${maven.multiproject.basedir}"
|
|
banner="Executing ${runGoal}"
|
|
projectList="${multiprojects}"
|
|
goals="${runGoal}"
|
|
ignoreFailures="${maven.multiproject.ignoreFailures}"/>
|
|
|
|
<j:remove var="internalGoal"/>
|
|
<j:remove var="runGoal"/>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Builds all artifacts for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:artifact"
|
|
description=" Builds all artifacts for all subproject">
|
|
|
|
<j:set var="internalGoal" value="multiproject:artifact-callback"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
|
|
</goal>
|
|
|
|
<goal name="multiproject:artifact-callback">
|
|
|
|
<ant:echo>Running ${maven.multiproject.type}:${maven.multiproject.type} for ${pom.name}</ant:echo>
|
|
<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="internalGoal" value="multiproject:install-callback"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
|
|
</goal>
|
|
|
|
<goal name="multiproject:install-callback">
|
|
<j:set var="g" value="${maven.multiproject.type}:install" />
|
|
<j:if test="${g == 'plugin:install'}">
|
|
<j:set var="g" value="plugin:repository-install" />
|
|
</j:if>
|
|
<ant:echo>Running ${g} for ${pom.name}</ant:echo>
|
|
<attainGoal name="${g}"/>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Run 'artifact':install-snapshot for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:install-snapshot"
|
|
description="Run 'artifact':install-snapshot for all subprojects">
|
|
|
|
<j:set var="internalGoal" value="multiproject:install-snapshot-callback"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
</goal>
|
|
|
|
<goal name="multiproject:install-snapshot-callback">
|
|
<j:set var="g" value="${maven.multiproject.type}:install-snapshot" />
|
|
<j:if test="${g == 'plugin:install-snapshot'}">
|
|
<j:set var="g" value="plugin:repository-install-snapshot" />
|
|
</j:if>
|
|
<ant:echo>Running ${g} for ${pom.name}</ant:echo>
|
|
<attainGoal name="${g}"/>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Run 'artifact':deploy for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:deploy"
|
|
description="Run 'artifact':deploy for all subprojects">
|
|
|
|
<j:set var="internalGoal" value="multiproject:deploy-callback"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
</goal>
|
|
|
|
<goal name="multiproject:deploy-callback">
|
|
<j:set var="g" value="${maven.multiproject.type}:deploy" />
|
|
<j:if test="${g == 'plugin:deploy'}">
|
|
<j:set var="g" value="plugin:repository-deploy" />
|
|
</j:if>
|
|
<ant:echo>Running ${g} for ${pom.name}</ant:echo>
|
|
<attainGoal name="${g}"/>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Run 'artifact':deploy-snapshot for all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:deploy-snapshot"
|
|
description="Run 'artifact':deploy-snapshot for all subprojects">
|
|
|
|
<j:set var="internalGoal" value="multiproject:deploy-snapshot-callback"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
</goal>
|
|
|
|
<goal name="multiproject:deploy-snapshot-callback">
|
|
<j:set var="g" value="${maven.multiproject.type}:deploy-snapshot" />
|
|
<j:if test="${g == 'plugin:deploy-snapshot'}">
|
|
<j:set var="g" value="plugin:repository-deploy-snapshot" />
|
|
</j:if>
|
|
<ant:echo>Running ${g} for ${pom.name}</ant:echo>
|
|
<attainGoal name="${g}"/>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Maven Report API - Register -->
|
|
<!--==================================================================-->
|
|
<goal name="maven-multiproject-plugin:register">
|
|
|
|
<doc:registerReport
|
|
name="Dependency Convergence"
|
|
link="dependency-convergence-report"
|
|
pluginName="maven-multiproject-plugin"
|
|
description="Generate report which shows how consistent are the versions of artifacts between projects."/>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Maven Report API - Deregister -->
|
|
<!--==================================================================-->
|
|
<goal name="maven-multiproject-plugin:deregister">
|
|
|
|
<doc:deregisterReport name="Multiproject Dependency Convergence Report"/>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Maven Report API - Report -->
|
|
<!--==================================================================-->
|
|
<goal name="maven-multiproject-plugin:report">
|
|
|
|
<attainGoal name="multiproject:dependency-convergence-report"/>
|
|
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Generate report which shows the harmony of -->
|
|
<!-- versions of dependencies which are used in sub-projects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:dependency-convergence-report"
|
|
prereqs="multiproject:projects-init"
|
|
description="Generate report which shows how consistent are the versions of artitfacts between projects" >
|
|
|
|
<mkdir dir="${maven.gen.docs}"/>
|
|
|
|
<j:useBean var="harmonizer" class="org.apache.maven.multiproject.harmonizer.DependencyHarmonizer"/>
|
|
${harmonizer.build(multiprojects)}
|
|
|
|
<j:set var="encoding" value="${maven.docs.outputencoding}"/>
|
|
<velocity:merge
|
|
name="${maven.gen.docs}/dependency-convergence-report.xml"
|
|
basedir="${plugin.resources}/templates"
|
|
template="dependency-convergence-report.xml"
|
|
inputEncoding="${encoding}"
|
|
outputEncoding="${encoding}"
|
|
/>
|
|
</goal>
|
|
|
|
<!--==================================================================-->
|
|
<!-- Cleans all subprojects -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:clean"
|
|
description="Clean all subprojects">
|
|
|
|
<j:set var="internalGoal" value="clean:clean"/>
|
|
<attainGoal name="multiproject:goal"/>
|
|
|
|
</goal>
|
|
|
|
|
|
<!--==================================================================-->
|
|
<!-- Deploy site documentation -->
|
|
<!--==================================================================-->
|
|
<goal name="multiproject:site-deploy" prereqs="multiproject:site"
|
|
description="Deploy site documentation" >
|
|
|
|
<attainGoal name="site:${maven.site.deploy.method}deploy"/>
|
|
|
|
</goal>
|
|
|
|
</project>
|