michal 2003/07/25 15:47:30
Modified: src/plugins-build/xdoc/xdocs changes.xml goals.xml
src/plugins-build/xdoc plugin.jelly project.xml
src/plugins-build/xdoc/src/plugin-resources/templates
dependencies.xml
Added: src/plugins-build/xdoc/src/main/org/apache/maven
DependencyDescriberBean.java
DescribedDependency.java
Log:
Dependency report was completely rewritten. Report generator is now aware of notion
of type and groupId.
In addition URL and Description (which was also added to the report)
of the dependency can be retrieved from its POM if there is one in the local
repository
Documentation of goals ported to new dedicated format
Update to maven 1.0-beta-10
Revision Changes Path
1.9 +12 -0 maven/src/plugins-build/xdoc/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/xdoc/xdocs/changes.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- changes.xml 25 Jul 2003 06:35:27 -0000 1.8
+++ changes.xml 25 Jul 2003 22:47:30 -0000 1.9
@@ -7,6 +7,18 @@
<body>
<release version="1.4" date="in CVS">
+ <action dev="michal" type="update">
+ Dependency report was completely rewritten.
+ Report generator is now aware of notion of type and groupId.
+ In addition URL and Description (which was also added to the report)
+ of the dependency can be taken from the POM if there is one in the local
repository
+ </action>
+ <action dev="michal" type="fix">
+ Documentation of goals ported to new dedicated format
+ </action>
+ <action dev="dion" type="update">
+ update to maven 1.0-beta-10
+ </action>
<action dev="dion" type="update">
update to velocity 1.4-dev
</action>
1.4 +28 -35 maven/src/plugins-build/xdoc/xdocs/goals.xml
Index: goals.xml
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/xdoc/xdocs/goals.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- goals.xml 2 Apr 2003 12:01:51 -0000 1.3
+++ goals.xml 25 Jul 2003 22:47:30 -0000 1.4
@@ -7,39 +7,32 @@
</properties>
<body>
- <section name="Goals">
- <table>
- <tr><th>Goal</th><th>Description</th></tr>
-
- <a name="xdoc" />
- <tr>
- <td>xdoc</td>
- <td>
- The default goal. This goal simply executes the
- <a href="#xdoc:generate-from-pom">xdoc:generate-from-pom</a>
- and <a href="#xdoc:transform">xdoc:transform</a> goals
- </td>
- </tr>
-
- <a name="xdoc:generate-from-pom" />
- <tr>
- <td>xdoc:generate-from-pom</td>
- <td>
- Generate a set of reports from your <code>project.xml</code> file.
- This includes the dependency, mailing list, project info, project
- reports and team list pages
- </td>
- </tr>
-
- <a name="init-dvsl-tag" />
- <tr>
- <td>init-dvsl-tag</td>
- <td>
- This goal defines the <code>DVSL</code> tag library for generating
- documentation. A single tag <code>dvsl:dvsl</code> is defined.
- </td>
- </tr>
- </table>
- </section>
+ <goals>
+
+ <goal>
+ <name>xdoc</name>
+ <description>
+ The default goal. This goal simply executes the
+ <a href="#xdoc:generate-from-pom">xdoc:generate-from-pom</a>
+ and <a href="#xdoc:transform">xdoc:transform</a> goals
+ </description>
+ </goal>
+ <goal>
+ <name>xdoc:generate-from-pom</name>
+ <description>
+ Generate a set of reports from your <code>project.xml</code> file.
+ This includes the dependency, mailing list, project info, project
+ reports and team list pages
+ </description>
+ </goal>
+ <goal>
+ <name>init-dvsl-tag</name>
+ <description>
+ This goal defines the <code>DVSL</code> tag library for generating
+ documentation. A single tag <code>dvsl:dvsl</code> is defined.
+ </description>
+ </goal>
+
+ </goals>
</body>
-</document>
+</document>
\ No newline at end of file
1.38 +5 -1 maven/src/plugins-build/xdoc/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/xdoc/plugin.jelly,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- plugin.jelly 24 Jul 2003 06:26:44 -0000 1.37
+++ plugin.jelly 25 Jul 2003 22:47:30 -0000 1.38
@@ -375,6 +375,10 @@
<j:useBean var="escape" class="org.apache.velocity.anakia.Escape"/>
<j:useBean var="files" class="org.apache.velocity.texen.util.FileUtil"/>
+ <!-- Need to enrich information about dependency by taking some information
from its POM. -->
+ <j:useBean var="dependencyDescriber"
class="org.apache.maven.DependencyDescriberBean"/>
+ ${dependencyDescriber.build(pom)}
+
<j:if test="${encoding == null}">
<j:set
@@ -598,7 +602,7 @@
<!-- mapper for determining output file name -->
<j:new var="mapper"
className="org.apache.maven.util.CaseInsensitiveGlobPatternMapper"/>
-
+
<!-- path tool for relative processing -->
<j:useBean var="pathTool" class="org.apache.maven.DVSLPathTool"/>
1.20 +13 -4 maven/src/plugins-build/xdoc/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/xdoc/project.xml,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- project.xml 25 Jul 2003 06:35:27 -0000 1.19
+++ project.xml 25 Jul 2003 22:47:30 -0000 1.20
@@ -51,6 +51,15 @@
<role>Java Developer</role>
</roles>
</developer>
+ <developer>
+ <name>Michal Maczka</name>
+ <id>mmaczka</id>
+ <email>[EMAIL PROTECTED]</email>
+ <organization>Dimatics</organization>
+ <roles>
+ <role>Java Developer</role>
+ </roles>
+ </developer>
</developers>
<dependencies>
<dependency>
@@ -94,10 +103,10 @@
<url>http://jakarta.apache.org/commons/jelly/libs/xml/</url>
</dependency>
<dependency>
- <id>maven</id>
- <version>b5</version>
- <jar>maven.jar</jar>
- </dependency>
+ <groupId>maven</groupId>
+ <artifactId>maven</artifactId>
+ <version>1.0-beta-10</version>
+ </dependency>
<dependency>
<id>velocity</id>
<version>1.4-dev</version>
1.3 +38 -24
maven/src/plugins-build/xdoc/src/plugin-resources/templates/dependencies.xml
Index: dependencies.xml
===================================================================
RCS file:
/home/cvs/maven/src/plugins-build/xdoc/src/plugin-resources/templates/dependencies.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dependencies.xml 15 May 2003 12:56:25 -0000 1.2
+++ dependencies.xml 25 Jul 2003 22:47:30 -0000 1.3
@@ -16,28 +16,42 @@
<p>
The following is a list of dependencies for this project. These
dependencies are required to compile and run the application:
- </p>
- <table>
- <tr>
- <th>ID</th>
- <th>Version</th>
- <th>JAR</th>
- </tr>
- #foreach ($dep in $project.dependencies)
- <tr>
- <td>
- #if ($dep.url && $dep.url.length() != 0)
- <a href="$escape.getText($dep.url)">$!dep.groupId</a>
- #else
- $!dep.groupId
- #end
- </td>
- <td>$!dep.version</td>
- <td>$!dep.artifact</td>
- </tr>
- #end
- </table>
- #end
- </section>
- </body>
+ </p>
+ #foreach ($dep in $dependencyDescriber.Dependencies)
+ <subsection name="${dep.Id}">
+ <table>
+ <tr>
+ <th width="10%">Group ID</th>
+ <td>${dep.GroupId}</td>
+ </tr>
+ <tr>
+ <th>Artifact ID</th>
+ <td>${dep.ArtifactId}</td>
+ </tr>
+ <tr>
+ <th>Type</th>
+ <td>${dep.Type}</td>
+ </tr>
+ <tr>
+ <th>Version</th>
+ <td>${dep.Version}</td>
+ </tr>
+ #if ($dep.Url)
+ <tr>
+ <th>URL</th>
+ <td><a href="${dep.Url}">${dep.Url}</a></td>
+ </tr>
+ #end
+ #if ($dep.Description)
+ <tr>
+ <th>Description</th>
+ <td>${dep.Description}</td>
+ </tr>
+ #end
+ </table>
+ </subsection>
+ #end
+ #end
+ </section>
+ </body>
</document>
1.1
maven/src/plugins-build/xdoc/src/main/org/apache/maven/DependencyDescriberBean.java
Index: DependencyDescriberBean.java
===================================================================
package org.apache.maven;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 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 [EMAIL PROTECTED]
*
* 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.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.apache.maven.project.Dependency;
import org.apache.maven.project.Project;
/**
* @author <a href="[EMAIL PROTECTED]">Michal Maczka</a>
* @version $Id: DependencyDescriberBean.java,v 1.1 2003/07/25 22:47:30 michal Exp $
*/
public class DependencyDescriberBean
{
/** */
private List dependencies = new ArrayList();
private Project project;
/**
* @return
*/
public List getDependencies()
{
return dependencies;
}
/**
* Project provides context/session related information.
* e.g where maven repo local is
* @param project
*/
public void build(Project project)
{
this.project = project;
for (Iterator iter = project.getDependencies().iterator();
iter.hasNext();
)
{
Dependency dependency = (Dependency) iter.next();
DescribedDependency describedDependency =
new DescribedDependency(dependency);
dependencies.add(describedDependency);
Project resolvedProject = resolveProject(dependency);
if (resolvedProject != null)
{
System.out.println("POM URL:" + resolvedProject.getUrl());
describedDependency.setUrl(resolvedProject.getUrl());
describedDependency.setDescription(
resolvedProject.getDescription());
}
}
Collections.sort(dependencies);
}
/**
* @param dependency
* @return
* @throws Exception
*/
private Project resolveProject(Dependency dependency)
{
File projectFile = null;
if ("pom".equals(dependency.getType()))
{
projectFile =
new File(
project.getContext().getMavenRepoLocal(),
dependency.getArtifact());
}
else
{
projectFile =
new File(
project.getContext().getMavenRepoLocal(),
dependency.getArtifactDirectory()
+ "/poms/"
+ dependency.getArtifactId()
+ "-"
+ dependency.getVersion()
+ ".pom");
}
try
{
if (projectFile.exists() && projectFile.canRead())
{
return MavenUtils.getProject(projectFile, null, false);
}
else
{
System.out.println("Failed to read POM:" + projectFile);
return null;
}
}
catch (Exception e)
{
System.out.println("Failed to read POM:" + projectFile);
return null;
}
}
}
1.1
maven/src/plugins-build/xdoc/src/main/org/apache/maven/DescribedDependency.java
Index: DescribedDependency.java
===================================================================
package org.apache.maven;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 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 [EMAIL PROTECTED]
*
* 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 org.apache.maven.project.Dependency;
/**
*
* @author <a href="[EMAIL PROTECTED]">Michal Maczka</a>
* @version $Id: DescribedDependency.java,v 1.1 2003/07/25 22:47:30 michal Exp $
*/
public class DescribedDependency implements Comparable
{
private Dependency dependency;
private String description = null;
private String url = null;
public DescribedDependency(Dependency dependency)
{
this.dependency = dependency;
}
/**
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
public int compareTo(Object obj)
{
DescribedDependency other = (DescribedDependency) obj;
return this.getId().compareTo(other.getId());
}
/**
* @return
*/
public String getArtifact()
{
return dependency.getArtifact();
}
/**
* @return
*/
public String getArtifactDirectory()
{
return dependency.getArtifactDirectory();
}
/**
* @return
*/
public String getArtifactId()
{
return dependency.getArtifactId();
}
/**
* @return
*/
public String getExtension()
{
return dependency.getExtension();
}
/**
* @return
*/
public String getGroupId()
{
return dependency.getGroupId();
}
/**
* @return
*/
public String getId()
{
return dependency.getId();
}
/**
* @return
*/
public String getJar()
{
return dependency.getJar();
}
/**
* @return
*/
public String getName()
{
return dependency.getName();
}
/**
* @return
*/
public String getType()
{
return dependency.getType();
}
/**
*
* @param url
*/
public void setUrl(String url)
{
this.url = url;
}
/**
* @return
*/
public String getUrl()
{
String retValue = null;
if (dependency.getUrl() != null && dependency.getUrl().length()>0)
{
retValue = dependency.getUrl();
}
else
{
return retValue = url;
}
return retValue;
}
/**
* @return
*/
public String getVersion()
{
return dependency.getVersion();
}
/**
/**
* @return
*/
public String getDescription()
{
return description;
}
/**
* @param description
*/
public void setDescription(String description)
{
this.description = description;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]