MPXDOC-129: add a comment property for dependencies

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@153147 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
felipeal 2005-02-10 03:05:31 +00:00
parent 7803d5857f
commit 41c70b7c45
5 changed files with 131 additions and 2 deletions

View File

@ -23,7 +23,7 @@ import org.apache.maven.project.Dependency;
* Dependency wrapper. Adds an url to download and a description.
*
* @author <a href="mailto:michal.maczka@dimatics.com">Michal Maczka</a>
* @version $Id: DescribedDependency.java,v 1.5 2004/09/21 13:47:53 brett Exp $
* @version $Id$
*/
public class DescribedDependency implements Comparable
{
@ -222,4 +222,11 @@ public class DescribedDependency implements Comparable
return this.getId().compareTo(other.getId());
}
/**
* Delegate method from Dependency.getProperty("comment")
*/
public String getComment() {
return dependency.getProperty("comment");
}
}

View File

@ -42,6 +42,7 @@
<th>Type</th>
<th>Version</th>
<th>URL</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
@ -55,6 +56,11 @@
<a href="${dep.Url}">${dep.Url}</a>
#end
</td>
<td>
#if(${dep.comment})
${dep.comment}
#end
</td>
</tr>
#end
</tbody>

View File

@ -0,0 +1,53 @@
<!--
/*
* 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 default="testPlugin"
xmlns:util="jelly:util"
xmlns:j="jelly:core"
xmlns:assert="assert"
xmlns:doc="doc"
xmlns:x="jelly:xml">
<goal name="testPlugin" prereqs="clean,xdoc:generate-from-pom, dependenciesTest"/>
<goal name="dependenciesTest">
<j:set var="depXmlPath" value="${maven.gen.docs}/dependencies.xml"/>
<assert:assertFileExists file="${depXmlPath}"/>
<util:file var="depXmlFile" name="${depXmlPath}"/>
<x:parse var="depXmlDom" xml="${depXmlFile}"/>
<x:set var="headerComment" select="string($depXmlDom/document/body/section[@name='Dependencies']/table/thead/tr/th[5])"/>
<assert:assertEquals expected="Comment" value="${headerComment}"/>
<x:forEach var="tr" select="$depXmlDom/document/body/section[@name='Dependencies']/table/tbody/*">
<x:set var="depName" select="string($tr/td[1])"/>
<x:set var="comment" select="string($tr/td[5])"/>
<j:if test="${depName=='dom4j'}">
<echo>Checking comment for dependency dom4j</echo>
<assert:assertEquals expected="Simple comment" value="${comment.trim()}"/>
</j:if>
<j:if test="${depName=='commons-jelly'}">
<echo>Checking comment for dependency commons-jelly</echo>
<assert:assertEquals expected="" value="${comment.trim()}"/>
</j:if>
<j:if test="${depName=='velocity-dvsl'}">
<echo>Checking comment for dependency velocity-dvsl</echo>
<assert:assertEquals expected="" value="${comment.trim()}"/>
</j:if>
</x:forEach>
</goal>
</project>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* 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>
<pomVersion>3</pomVersion>
<name>Test project for Maven Xdoc Plugin new feature: dependencies comment</name>
<shortDescription>Test for dependencies comment</shortDescription>
<description>Test project for Maven Xdoc Plugin new feature: dependencies comment (MPXDOC-129)</description>
<groupId>maven</groupId>
<artifactId>test-maven-xdoc-plugin-testDependenciesComment</artifactId>
<currentVersion>1.0</currentVersion>
<dependencies>
<!-- dependency with a simple comment -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.4-dev-8</version>
<properties>
<comment>Simple comment</comment>
</properties>
</dependency>
<!-- dependency with a blank comment -->
<dependency>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly</artifactId>
<version>1.0-RC1</version>
<properties>
<comment/>
</properties>
</dependency>
<!-- dependency with no comment at all -->
<dependency>
<groupId>velocity-dvsl</groupId>
<artifactId>velocity-dvsl</artifactId>
<version>0.45</version>
</dependency>
</dependencies>
<reports>
<!-- set a bogus report -->
<report>maven-tasklist-plugin</report>
</reports>
</project>

View File

@ -27,8 +27,9 @@
</properties>
<body>
<release version="1.9-SNAPSHOT" date="in CVS">
<action dev="felipeal" type="add" issue="MPXDOC-129" due-to="Miguel Griffa">Add a <code>comment</code> property for dependencies</action>
<action dev="brett" type="add">Added maven.xdoc.copy.excludes property which lists the files to exclude from the resources copy. This defaults to any images currently unused by Maven. Additionally, if you are not using the classic theme, maven.xdoc.copy.excludes.classic is used to eliminate images only for the classic theme</action>
<action dev="felipel" type="add" issue="MPXDOC-118">Added new tag <code>&lt;escapeXml&gt;</code>.</action>
<action dev="felipeal" type="add" issue="MPXDOC-118">Added new tag <code>&lt;escapeXml&gt;</code>.</action>
<action dev="epugh" type="add" issue="MPXDOC-124" due-to="Shinobu Kawai">Maven xdoc plugin clean up generated velocity log as part of calling clean.</action>
<action dev="aheritier" type="add" issue="MPXDOC-123">New property (maven.xdoc.xml.copy) to copy only and not transform some xml files provided in the ${maven.docs.src} directory.</action>
<action dev="brett" type="update">Make compatible with Maven 1.1</action>