You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by js...@apache.org on 2003/01/07 09:23:28 UTC
cvs commit: jakarta-turbine-maven/src/plugins-build/javadoc plugin.jelly
jstrachan 2003/01/07 00:23:28
Modified: src/java/org/apache/maven/project Project.java
src/plugins-build/javadoc plugin.jelly
Added: src/java/org/apache/maven/project PackageGroup.java
Log:
Javadoc allows you to group packages together into groups to describe them.
http://jakarta.apache.org/ant/manual/CoreTasks/javadoc.html#groupelement
You can use this mechanism to describe the core APIs, optional packages, implementation packages and so forth.
I've added support for this to Maven, by adding a new property to the POM called 'packageGroups' which is a list of PackageGroup instances which can have a title and a packages filter. This allows you to group the packages together when generating javadoc.
Revision Changes Path
1.60 +40 -2 jakarta-turbine-maven/src/java/org/apache/maven/project/Project.java
Index: Project.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/project/Project.java,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- Project.java 6 Jan 2003 06:18:03 -0000 1.59
+++ Project.java 7 Jan 2003 08:23:27 -0000 1.60
@@ -216,6 +216,11 @@
private Map pluginContexts = new HashMap();
/**
+ * A list of PackageGroup instances used for documenting the packages
+ */
+ private List packageGroups;
+
+ /**
* Default constructor.
*/
public Project()
@@ -229,7 +234,8 @@
dependencyMap = new HashMap();
goalNames = new ArrayList();
reports = new ArrayList();
-}
+ packageGroups = new ArrayList();
+ }
// ----------------------------------------------------------------------
// A C C E S S O R S
@@ -1066,6 +1072,38 @@
return logo;
}
+ /**
+ * Returns a list of PackageGroup instances used for documenting the
+ * packages
+ *
+ * @return the list of PackageGroup instances
+ */
+ public List getPackageGroups()
+ {
+ return packageGroups;
+ }
+
+ /**
+ * Sets the list of PackageGroup instances used for documenting the packages
+ *
+ * @param packageGroups is the list of PackageGroup instances
+ */
+ public void setPackageGroups(List packageGroups)
+ {
+ this.packageGroups = packageGroups;
+ }
+
+ /**
+ * Adds a new PackageGroup to this project
+ *
+ * @param packageGroup is the new PackageGroup instance to be added to the
+ * list
+ */
+ public void addPackageGroup(PackageGroup packageGroup)
+ {
+ packageGroups.add(packageGroup);
+ }
+
/**
* Create a dom4j document from the POM. Used for dvsl processing right now.
* Hopefully we can make this more general so that people
1.1 jakarta-turbine-maven/src/java/org/apache/maven/project/PackageGroup.java
Index: PackageGroup.java
===================================================================
package org.apache.maven.project;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2002 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 MavenSession" 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 MavenSession", 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/>.
*
* ====================================================================
*/
/**
* A PackageGroup is a group of packages with a title which is used to document
* the packages inside a project when creating the javadoc.
*
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
* @version PackageGroup.java,v 1.1 2003/01/07 08:23:27 jstrachan Exp
*/
public class PackageGroup
extends BaseObject
{
private String title;
private String packages;
/**
* Returns the package patterns.
* @return String
*/
public String getPackages()
{
return packages;
}
/**
* Returns the title of this package group.
*
* @return String
*/
public String getTitle()
{
return title;
}
/**
* Sets the package patterns to use.
*
* @param packages The packages to set
*/
public void setPackages(String packages)
{
this.packages = packages;
}
/**
* Sets the title of this package group.
*
* @param title The title to set
*/
public void setTitle(String title)
{
this.title = title;
}
}
1.10 +4 -0 jakarta-turbine-maven/src/plugins-build/javadoc/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/javadoc/plugin.jelly,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- plugin.jelly 1 Jan 2003 15:25:31 -0000 1.9
+++ plugin.jelly 7 Jan 2003 08:23:28 -0000 1.10
@@ -72,6 +72,10 @@
<j:if test="${maxMemory != null}">
<setProperty name="maxmemory" value="${maven.javadoc.maxmemory}" />
</j:if>
+
+ <j:forEach var="packageGroup" items="${pom.packageGroups}">
+ <group title="${packageGroup.title}" packages="${packageGroup.packages}"/>
+ </j:forEach>
</javadoc>
<record name="${maven.build.dir}/javadoc/report.txt" action="stop" />