Initial release of multichanges plugin. It generates a release dashboard for all subprojects. An example can be found at http://maven.apache.org/reference/plugins/optional/release-report.html
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114306 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
6
multichanges/.cvsignore
Normal file
6
multichanges/.cvsignore
Normal file
@@ -0,0 +1,6 @@
|
||||
target
|
||||
velocity.log
|
||||
maven.log
|
||||
build.properties
|
||||
.classpath
|
||||
.project
|
||||
106
multichanges/plugin.jelly
Normal file
106
multichanges/plugin.jelly
Normal file
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project
|
||||
xmlns:j="jelly:core"
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns:define="jelly:define"
|
||||
xmlns:util="jelly:util"
|
||||
xmlns:m="jelly:maven"
|
||||
xmlns:x="jelly:xml"
|
||||
xmlns:doc="doc">
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
Generate a multiproject release report, providing a unified view of
|
||||
the latest release of projects.
|
||||
========================================================================
|
||||
-->
|
||||
<goal name="multichanges:report">
|
||||
|
||||
<m:reactor
|
||||
basedir="${maven.multichanges.basedir}"
|
||||
banner="Gathering project list"
|
||||
includes="${maven.multichanges.includes}"
|
||||
excludes="${maven.multichanges.excludes}"
|
||||
postProcessing="true"
|
||||
ignoreFailures="${maven.multichanges.ignoreFailures}"/>
|
||||
|
||||
<ant:dirname property="dataReportDir" file="${maven.multichanges.data}"/>
|
||||
<ant:mkdir dir="${dataReportDir}"/>
|
||||
|
||||
<j:file name="${maven.multichanges.data}" prettyPrint="true"
|
||||
xmlns="release">
|
||||
<releases>
|
||||
<j:forEach var="reactorProject" items="${reactorProjects}">
|
||||
<x:element name="project">
|
||||
<x:attribute name="name">
|
||||
${reactorProject.name}
|
||||
</x:attribute>
|
||||
<util:file var="changesAsFile"
|
||||
name="${reactorProject.context.getVariable('maven.docs.src')}/changes.xml"/>
|
||||
<j:choose>
|
||||
<j:when test="${changesAsFile.exists()}">
|
||||
<x:parse var="doc" xml="${changesAsFile}"/>
|
||||
<!-- Extract latest version. We assume it is contained in
|
||||
the first <release> tag found -->
|
||||
<!-- TODO: Improve algorithm by writing a java bean -->
|
||||
<x:set var="versionElems"
|
||||
select="$doc//release[contains(@date,'-')]"/>
|
||||
<j:choose>
|
||||
<j:when test="${not(versionElems.isEmpty())}">
|
||||
<x:attribute name="version">
|
||||
${versionElems.get(0).attributeValue('version')}
|
||||
</x:attribute>
|
||||
<x:attribute name="date">
|
||||
${versionElems.get(0).attributeValue('date')}
|
||||
</x:attribute>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<x:attribute name="version">
|
||||
Not released
|
||||
</x:attribute>
|
||||
<x:attribute name="date">
|
||||
Not released
|
||||
</x:attribute>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<x:attribute name="version">
|
||||
No information available
|
||||
</x:attribute>
|
||||
<x:attribute name="date">
|
||||
No information available
|
||||
</x:attribute>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
</x:element>
|
||||
</j:forEach>
|
||||
</releases>
|
||||
</j:file>
|
||||
|
||||
<ant:dirname property="reportDir" file="${maven.multichanges.report}"/>
|
||||
<ant:mkdir dir="${reportDir}"/>
|
||||
|
||||
<doc:jsl
|
||||
input="${maven.multichanges.data}"
|
||||
output="${maven.multichanges.report}.xml"
|
||||
stylesheet="${plugin.resources}/releases.jsl"
|
||||
outputMode="xml"
|
||||
prettyPrint="true"/>
|
||||
|
||||
</goal>
|
||||
|
||||
<goal name="maven-multichanges-plugin:register">
|
||||
<doc:registerReport
|
||||
name="Releases"
|
||||
pluginName="multichanges"
|
||||
link="${maven.multichanges.report}"
|
||||
description="Report on latest project releases."/>
|
||||
</goal>
|
||||
|
||||
<goal name="maven-multichanges-plugin:deregister">
|
||||
<doc:deregisterReport name="Releases"/>
|
||||
</goal>
|
||||
|
||||
</project>
|
||||
16
multichanges/plugin.properties
Normal file
16
multichanges/plugin.properties
Normal file
@@ -0,0 +1,16 @@
|
||||
# -------------------------------------------------------------------
|
||||
# P L U G I N P R O P E R I E S
|
||||
# -------------------------------------------------------------------
|
||||
# Multichanges plugin.
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
maven.multichanges.basedir=${basedir}
|
||||
maven.multichanges.includes=*/project.xml
|
||||
maven.multichanges.excludes=**/target/**/project.xml,project.xml
|
||||
maven.multichanges.ignoreFailures=false
|
||||
|
||||
# Generated dashboard raw data file
|
||||
maven.multichanges.data = ${maven.build.dir}/multichanges.xml
|
||||
|
||||
# Report name (without extension)
|
||||
maven.multichanges.report = multichanges-report
|
||||
6
multichanges/project.properties
Normal file
6
multichanges/project.properties
Normal file
@@ -0,0 +1,6 @@
|
||||
# -------------------------------------------------------------------
|
||||
# P R O J E C T P R O P E R T I E S
|
||||
# -------------------------------------------------------------------
|
||||
maven.xdoc.date=left
|
||||
maven.xdoc.version=${pom.currentVersion}
|
||||
maven.license.licenseFile=${basedir}/../LICENSE.txt
|
||||
45
multichanges/project.xml
Normal file
45
multichanges/project.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project>
|
||||
<extend>../project.xml</extend>
|
||||
<pomVersion>3</pomVersion>
|
||||
<id>maven-multichanges-plugin</id>
|
||||
<name>Maven MultiChanges plugin</name>
|
||||
<currentVersion>1.0-SNAPSHOT</currentVersion>
|
||||
<shortDescription>Produce release dashboard for subprojects</shortDescription>
|
||||
<url>http://maven.apache.org/reference/plugins/multichanges/</url>
|
||||
<siteDirectory>/www/maven.apache.org/reference/plugins/multichanges/</siteDirectory>
|
||||
<repository>
|
||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/multichanges/</connection>
|
||||
<url>http://cvs.apache.org/viewcvs/maven-plugins/multichanges/</url>
|
||||
</repository>
|
||||
<versions>
|
||||
<version>
|
||||
<id>1.0</id>
|
||||
<name>1.0</name>
|
||||
<tag>HEAD</tag>
|
||||
</version>
|
||||
</versions>
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Vincent Massol</name>
|
||||
<id>vmassol</id>
|
||||
<email>vmassol@pivolis.com</email>
|
||||
<organization>Pivolis</organization>
|
||||
<roles>
|
||||
<role>Creator</role>
|
||||
<role>Java Developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
<dependencies/>
|
||||
<reports>
|
||||
<report>maven-changes-plugin</report>
|
||||
<report>maven-changelog-plugin</report>
|
||||
<report>maven-file-activity-plugin</report>
|
||||
<report>maven-developer-activity-plugin</report>
|
||||
<report>maven-file-activity-plugin</report>
|
||||
<report>maven-license-plugin</report>
|
||||
<report>maven-linkcheck-plugin</report>
|
||||
</reports>
|
||||
</project>
|
||||
74
multichanges/src/plugin-resources/releases.jsl
Normal file
74
multichanges/src/plugin-resources/releases.jsl
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<jsl:stylesheet
|
||||
select="$doc"
|
||||
xmlns:j="jelly:core"
|
||||
xmlns:jsl="jelly:jsl"
|
||||
xmlns:x="jelly:xml"
|
||||
xmlns="dummy" trim="false">
|
||||
|
||||
<jsl:template match="releases">
|
||||
<document>
|
||||
<properties>
|
||||
<title>Latest releases</title>
|
||||
</properties>
|
||||
<body>
|
||||
<section name="Latest releases">
|
||||
<table>
|
||||
<tr>
|
||||
<th>Project name</th>
|
||||
<th>Latest version</th>
|
||||
<th>Released date</th>
|
||||
</tr>
|
||||
<x:set var="projects" sort="@date" descending="true"
|
||||
select="project[not(@date = 'Not released') and not(@date = 'No information available')]"/>
|
||||
<j:forEach var="project" items="${projects}">
|
||||
<tr>
|
||||
<td>
|
||||
<x:expr select="$project/@name"/>
|
||||
</td>
|
||||
<td>
|
||||
<x:expr select="$project/@version"/>
|
||||
</td>
|
||||
<td>
|
||||
<x:expr select="$project/@date"/>
|
||||
</td>
|
||||
</tr>
|
||||
</j:forEach>
|
||||
<x:set var="projects" sort="@date" descending="true"
|
||||
select="project[@date = 'Not released']"/>
|
||||
<j:forEach var="project" items="${projects}">
|
||||
<tr>
|
||||
<td>
|
||||
<x:expr select="$project/@name"/>
|
||||
</td>
|
||||
<td>
|
||||
<x:expr select="$project/@version"/>
|
||||
</td>
|
||||
<td>
|
||||
<x:expr select="$project/@date"/>
|
||||
</td>
|
||||
</tr>
|
||||
</j:forEach>
|
||||
<x:set var="projects" sort="@date" descending="true"
|
||||
select="project[@date = 'No information available']"/>
|
||||
<j:forEach var="project" items="${projects}">
|
||||
<tr>
|
||||
<td>
|
||||
<x:expr select="$project/@name"/>
|
||||
</td>
|
||||
<td>
|
||||
<x:expr select="$project/@version"/>
|
||||
</td>
|
||||
<td>
|
||||
<x:expr select="$project/@date"/>
|
||||
</td>
|
||||
</tr>
|
||||
</j:forEach>
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
</jsl:template>
|
||||
|
||||
</jsl:stylesheet>
|
||||
1
multichanges/xdocs/.cvsignore
Normal file
1
multichanges/xdocs/.cvsignore
Normal file
@@ -0,0 +1 @@
|
||||
stylesheets
|
||||
18
multichanges/xdocs/changes.xml
Normal file
18
multichanges/xdocs/changes.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
<properties>
|
||||
<title>Changes</title>
|
||||
<author email="vmassol@apache.org">Vincent Massol</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
|
||||
<release version="1.0" date="in CVS">
|
||||
<action dev="vmassol" type="add">
|
||||
Initial creation.
|
||||
</action>
|
||||
</release>
|
||||
|
||||
</body>
|
||||
</document>
|
||||
|
||||
28
multichanges/xdocs/goals.xml
Normal file
28
multichanges/xdocs/goals.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Maven Multichanges plugin Goals</title>
|
||||
<author email="vmassol@apache.org">Vincent Massol</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Goals">
|
||||
<p>
|
||||
This plugin is called automatically by the
|
||||
<code>site</code> plugin when it generates the project
|
||||
web site.
|
||||
</p>
|
||||
<table>
|
||||
<tr><th>Goal</th><th>Description</th></tr>
|
||||
<tr>
|
||||
<td>multichanges:report</td>
|
||||
<td>
|
||||
Generate the release dashboard showing the latest release dates
|
||||
and versions of the different subprojects.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
20
multichanges/xdocs/index.xml
Normal file
20
multichanges/xdocs/index.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Maven Multichanges plugin</title>
|
||||
<author email="vmassol@apache.org">Vincent Massol</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Maven Multichanges plugin">
|
||||
<p>
|
||||
Generate a release dashboard from information found in
|
||||
project <code>changes.xml</code> files. This plugin operates
|
||||
on all subprojects. It shows the latest release dates and
|
||||
versions of all subprojects.
|
||||
</p>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</document>
|
||||
16
multichanges/xdocs/navigation.xml
Normal file
16
multichanges/xdocs/navigation.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<project name="Maven Multichanges plugin">
|
||||
|
||||
<title>Maven MultiChanges plugin</title>
|
||||
|
||||
<body>
|
||||
<links>
|
||||
<item name="Maven" href="http://maven.apache.org/"/>
|
||||
</links>
|
||||
<menu name="Overview">
|
||||
<item name="Goals" href="/goals.html" />
|
||||
<item name="Properties" href="/properties.html" />
|
||||
</menu>
|
||||
</body>
|
||||
</project>
|
||||
25
multichanges/xdocs/properties.xml
Normal file
25
multichanges/xdocs/properties.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Multichanges properties</title>
|
||||
<author email="vmassol@apache.org">Vincent Massol</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Multichanges properties">
|
||||
<source><![CDATA[
|
||||
maven.multichanges.basedir=${basedir}
|
||||
maven.multichanges.includes=*/project.xml
|
||||
maven.multichanges.excludes=**/target/**/project.xml,project.xml
|
||||
maven.multichanges.ignoreFailures=false
|
||||
|
||||
# Generated dashboard raw data file
|
||||
maven.multichanges.data = ${maven.build.dir}/multichanges.xml
|
||||
|
||||
# Report name (without extension)
|
||||
maven.multichanges.report = multichanges-report
|
||||
]]></source>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
Reference in New Issue
Block a user