New plugin. Automatically generate release notes.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114368 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ec057c05f1
commit
6a6b54f9ab
6
announcement/.cvsignore
Normal file
6
announcement/.cvsignore
Normal file
@ -0,0 +1,6 @@
|
||||
target
|
||||
velocity.log
|
||||
maven.log
|
||||
build.properties
|
||||
.classpath
|
||||
.project
|
||||
49
announcement/plugin.jelly
Normal file
49
announcement/plugin.jelly
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project
|
||||
xmlns:j="jelly:core"
|
||||
xmlns:x="jelly:xml"
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns:define="jelly:define"
|
||||
xmlns:util="jelly:util"
|
||||
xmlns:doc="doc">
|
||||
|
||||
<goal name="announcement" prereqs="announcement:generate"
|
||||
description="Generate release announcement"/>
|
||||
|
||||
<goal name="announcement:generate"
|
||||
description="Generate release announcement">
|
||||
|
||||
<util:file var="inputFile" name="${maven.docs.src}/changes.xml"/>
|
||||
<x:parse var="doc" xml="${inputFile}"/>
|
||||
|
||||
<j:set var="stylesheetURI"
|
||||
value="file:${plugin.resources}/announcement.jsl"/>
|
||||
<j:file
|
||||
name="${maven.build.dir}/announcement.txt"
|
||||
outputMode="xml"
|
||||
omitXmlDeclaration="true"
|
||||
prettyPrint="false">
|
||||
<j:include uri="${stylesheetURI.toString()}"/>
|
||||
</j:file>
|
||||
|
||||
</goal>
|
||||
|
||||
<goal name="announcement:text" prereqs="announcement:generate"
|
||||
description="Generate release announcement">
|
||||
|
||||
<util:file var="inputFile" name="${maven.docs.src}/changes.xml"/>
|
||||
<x:parse var="doc" xml="${inputFile}"/>
|
||||
|
||||
<j:set var="stylesheetURI"
|
||||
value="file:${plugin.resources}/announcement.jsl"/>
|
||||
<j:file
|
||||
name="${maven.build.dir}/announcement.xml"
|
||||
outputMode="xml"
|
||||
prettyPrint="false">
|
||||
<j:include uri="${stylesheetURI.toString()}"/>
|
||||
</j:file>
|
||||
|
||||
</goal>
|
||||
|
||||
</project>
|
||||
6
announcement/plugin.properties
Normal file
6
announcement/plugin.properties
Normal file
@ -0,0 +1,6 @@
|
||||
# -------------------------------------------------------------------
|
||||
# Properties for the Announcement plugin
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
# Version for which to create a release note.
|
||||
maven.announcement.version = ${pom.currentVersion}
|
||||
6
announcement/project.properties
Normal file
6
announcement/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
|
||||
40
announcement/project.xml
Normal file
40
announcement/project.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project>
|
||||
<extend>../project.xml</extend>
|
||||
<pomVersion>3</pomVersion>
|
||||
<id>maven-announcement-plugin</id>
|
||||
<name>Maven Announcement plugin</name>
|
||||
<currentVersion>1.0-SNAPSHOT</currentVersion>
|
||||
<shortDescription>Produce release announcement</shortDescription>
|
||||
<url>http://maven.apache.org/reference/plugins/announcement/</url>
|
||||
<!-- TODO: Create JIRA project and replace xxxx by JIRA project id -->
|
||||
<issueTrackingUrl>http://jira.codehaus.org/BrowseProject.jspa?id=xxxx</issueTrackingUrl>
|
||||
<siteDirectory>/www/maven.apache.org/reference/plugins/announcement/</siteDirectory>
|
||||
<repository>
|
||||
<connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-plugins/announcement/</connection>
|
||||
<url>http://cvs.apache.org/viewcvs/maven-plugins/announcement/</url>
|
||||
</repository>
|
||||
<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>
|
||||
@ -0,0 +1,97 @@
|
||||
package org.apache.maven.announcement;
|
||||
|
||||
/* ====================================================================
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 2001 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. The end-user documentation included with the redistribution,
|
||||
* if any, must include the following acknowledgment:
|
||||
* "This product includes software developed by the
|
||||
* Apache Software Foundation (http://www.apache.org/)."
|
||||
* Alternately, this acknowledgment may appear in the software itself,
|
||||
* if and wherever such third-party acknowledgments normally appear.
|
||||
*
|
||||
* 4. The names "Apache" and "Apache Software Foundation" and
|
||||
* "Apache Maven" must not be used to endorse or promote products
|
||||
* derived from this software without prior written permission. For
|
||||
* written permission, please contact apache@apache.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "Apache",
|
||||
* "Apache Maven", nor may "Apache" appear in their name, without
|
||||
* prior written permission of the Apache Software Foundation.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This software consists of voluntary contributions made by many
|
||||
* individuals on behalf of the Apache Software Foundation. For more
|
||||
* information on the Apache Software Foundation, please see
|
||||
* <http://www.apache.org/>.
|
||||
*
|
||||
* ====================================================================
|
||||
*/
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
|
||||
*
|
||||
* @version $Id: Formatter.java,v 1.1 2003/11/16 22:48:57 vmassol Exp $
|
||||
*/
|
||||
public class Formatter
|
||||
{
|
||||
public static List format(String text, int column)
|
||||
{
|
||||
StringTokenizer st = new StringTokenizer(text, " \t\r\n");
|
||||
List strings = new ArrayList();
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
while (st.hasMoreTokens())
|
||||
{
|
||||
String token = (String) st.nextToken();
|
||||
if (buffer.length() + token.length() <= column)
|
||||
{
|
||||
buffer.append(token);
|
||||
buffer.append(' ');
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer.append('\r');
|
||||
buffer.append('\n');
|
||||
strings.add(buffer.toString());
|
||||
buffer = new StringBuffer();
|
||||
buffer.append(token);
|
||||
buffer.append(' ');
|
||||
}
|
||||
}
|
||||
buffer.append('\r');
|
||||
buffer.append('\n');
|
||||
strings.add(buffer.toString());
|
||||
return strings;
|
||||
}
|
||||
}
|
||||
64
announcement/src/plugin-resources/announcement.jsl
Normal file
64
announcement/src/plugin-resources/announcement.jsl
Normal file
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<jsl:stylesheet
|
||||
select="$doc"
|
||||
xmlns:j="jelly:core"
|
||||
xmlns:jsl="jelly:jsl"
|
||||
xmlns:x="jelly:xml"
|
||||
xmlns="dummy" trim="true">
|
||||
|
||||
<jsl:template match="document/body/release">
|
||||
|
||||
<x:set var="version" select="string(@version)"/>
|
||||
<j:set var="versionVariable" value="${context.getVariable('maven.announcement.version')}"/>
|
||||
|
||||
<j:if test="${versionVariable.equals(version)}">
|
||||
|
||||
<j:useBean var="formatter" class="org.apache.maven.announcement.Formatter"/>
|
||||
|
||||
<j:set var="header" value="The Maven team is pleased to announce the ${pom.name} ${versionVariable} release!"/>
|
||||
<j:set var="formattedHeader" value="${formatter.format(header,78)}"/>
|
||||
<!-- TODO: Find out why brackets are added -->
|
||||
<j:expr value="${formattedHeader}"/>
|
||||
|
||||
<!-- TODO: Need line break here -->
|
||||
|
||||
<j:expr value="${pom.url}"/>
|
||||
|
||||
<!-- TODO: Need line break here -->
|
||||
|
||||
<j:expr value="Changes in this version include (last changes first):"/>
|
||||
|
||||
<x:forEach var="action" select="action">
|
||||
<x:set var="text" select="string($action)"/>
|
||||
<j:expr value="o "/>
|
||||
<j:forEach var="line" items="${formatter.format(text,75)}">
|
||||
<!-- TODO: Need to add 3 spaces on second line and thereafter -->
|
||||
<j:expr value="${line}"/>
|
||||
</j:forEach>
|
||||
</x:forEach>
|
||||
|
||||
<!-- TODO: Need line break here -->
|
||||
|
||||
<j:expr value="This plugin has been tested with Maven [TODO]. Using it with"/>
|
||||
<j:expr value="another version of Maven is at your own risks! :-)"/>
|
||||
|
||||
<!-- TODO: Need line break here -->
|
||||
|
||||
<j:expr value="You can download the ${pom.name} here:"/>
|
||||
<j:expr value="${maven.repo.remote}/${pom.groupId}/jars/${pom.artifactId}-${versionVariable}.jar"/>
|
||||
|
||||
<!-- TODO: Need line break here -->
|
||||
|
||||
<j:expr value="Have fun!"/>
|
||||
<j:expr value="-The development team"/>
|
||||
|
||||
</j:if>
|
||||
|
||||
</jsl:template>
|
||||
|
||||
<jsl:template match="@*"/>
|
||||
|
||||
<jsl:template match="text()"/>
|
||||
|
||||
</jsl:stylesheet>
|
||||
1
announcement/xdocs/.cvsignore
Normal file
1
announcement/xdocs/.cvsignore
Normal file
@ -0,0 +1 @@
|
||||
stylesheets
|
||||
18
announcement/xdocs/changes.xml
Normal file
18
announcement/xdocs/changes.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
<properties>
|
||||
<title>Announcement plugin 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>
|
||||
|
||||
22
announcement/xdocs/goals.xml
Normal file
22
announcement/xdocs/goals.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Maven Announcement plugin goals</title>
|
||||
<author email="vmassol@apache.org">Vincent Massol</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Goals">
|
||||
<table>
|
||||
<tr><th>Goal</th><th>Description</th></tr>
|
||||
<tr>
|
||||
<td>announcement:text</td>
|
||||
<td>
|
||||
Generate text release announcement.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
18
announcement/xdocs/index.xml
Normal file
18
announcement/xdocs/index.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Maven Announcement plugin</title>
|
||||
<author email="vmassol@apache.org">Vincent Massol</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Maven Announcement plugin">
|
||||
<p>
|
||||
Generates release announcements. It takes information from the
|
||||
POM and from the <code>changes.xml</code> file and using a template
|
||||
generates release information.
|
||||
</p>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
15
announcement/xdocs/navigation.xml
Normal file
15
announcement/xdocs/navigation.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<project name="Maven Announcement plugin">
|
||||
|
||||
<title>Maven Announcement 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>
|
||||
26
announcement/xdocs/properties.xml
Normal file
26
announcement/xdocs/properties.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<document>
|
||||
|
||||
<properties>
|
||||
<title>Announcement plugin properties</title>
|
||||
<author email="vmassol@apache.org">Vincent Massol</author>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
<section name="Announcement plugin properties">
|
||||
<table>
|
||||
<tr><th>Property</th><th>Optional?</th><th>Description</th><th>Default</th></tr>
|
||||
<tr>
|
||||
<td>maven.announcement.version</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Version for which to create a release note.
|
||||
</td>
|
||||
<td>
|
||||
${pom.currentVersion}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
@ -5,6 +5,10 @@ maven.xdoc.date.format = dd MMMM yyyy HH:mm z
|
||||
# Enable HTML to xdoc transformation
|
||||
maven.html2xdoc.enabled=true
|
||||
|
||||
# Choose aggregators to use for the dashboard plugin report
|
||||
maven.dashboard.aggregators = csall,clovertpc,cloverloc,cloverncloc
|
||||
maven.clover.report.xml=true
|
||||
|
||||
#------------------------------------------------------------------
|
||||
# M U L T I P R O J E C T - A L L P L U G I N G S
|
||||
#------------------------------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user