diff --git a/xdoc/plugin.jelly b/xdoc/plugin.jelly index 39a8fb5d..527cb72c 100644 --- a/xdoc/plugin.jelly +++ b/xdoc/plugin.jelly @@ -375,6 +375,10 @@ + + + ${dependencyDescriber.build(pom)} + - + diff --git a/xdoc/project.xml b/xdoc/project.xml index 4a4690a4..d652d8bb 100644 --- a/xdoc/project.xml +++ b/xdoc/project.xml @@ -51,6 +51,15 @@ Java Developer + + Michal Maczka + mmaczka + michal.maczka@dimatics.com + Dimatics + + Java Developer + + @@ -94,10 +103,10 @@ http://jakarta.apache.org/commons/jelly/libs/xml/ - maven - b5 - maven.jar - + maven + maven + 1.0-beta-10 + velocity 1.4-dev diff --git a/xdoc/src/main/org/apache/maven/DependencyDescriberBean.java b/xdoc/src/main/org/apache/maven/DependencyDescriberBean.java new file mode 100644 index 00000000..1fb0466e --- /dev/null +++ b/xdoc/src/main/org/apache/maven/DependencyDescriberBean.java @@ -0,0 +1,158 @@ +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 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 + * . + * + * ==================================================================== + */ +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 Michal Maczka + * @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; + } + } +} diff --git a/xdoc/src/main/org/apache/maven/DescribedDependency.java b/xdoc/src/main/org/apache/maven/DescribedDependency.java new file mode 100644 index 00000000..6d7477ec --- /dev/null +++ b/xdoc/src/main/org/apache/maven/DescribedDependency.java @@ -0,0 +1,211 @@ +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 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 + * . + * + * ==================================================================== + */ + +import org.apache.maven.project.Dependency; + +/** + * + * @author Michal Maczka + * @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; + } + +} diff --git a/xdoc/src/plugin-resources/templates/dependencies.xml b/xdoc/src/plugin-resources/templates/dependencies.xml index 5cd72ec2..1a8a94f7 100644 --- a/xdoc/src/plugin-resources/templates/dependencies.xml +++ b/xdoc/src/plugin-resources/templates/dependencies.xml @@ -16,28 +16,42 @@

The following is a list of dependencies for this project. These dependencies are required to compile and run the application: -

- - - - - - - #foreach ($dep in $project.dependencies) - - - - - - #end -
IDVersionJAR
- #if ($dep.url && $dep.url.length() != 0) - $!dep.groupId - #else - $!dep.groupId - #end - $!dep.version$!dep.artifact
- #end - - +

+ #foreach ($dep in $dependencyDescriber.Dependencies) + + + + + + + + + + + + + + + + + + + #if ($dep.Url) + + + + + #end + #if ($dep.Description) + + + + + #end +
Group ID${dep.GroupId}
Artifact ID${dep.ArtifactId}
Type${dep.Type}
Version${dep.Version}
URL${dep.Url}
Description${dep.Description}
+
+ #end + #end + + diff --git a/xdoc/xdocs/changes.xml b/xdoc/xdocs/changes.xml index 9f61104a..9e861e62 100644 --- a/xdoc/xdocs/changes.xml +++ b/xdoc/xdocs/changes.xml @@ -7,6 +7,18 @@ + + 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 + + + Documentation of goals ported to new dedicated format + + + update to maven 1.0-beta-10 + update to velocity 1.4-dev diff --git a/xdoc/xdocs/goals.xml b/xdoc/xdocs/goals.xml index 7a5cb71a..daf729b9 100644 --- a/xdoc/xdocs/goals.xml +++ b/xdoc/xdocs/goals.xml @@ -7,39 +7,32 @@ -
- - - - - - - - - - - - - - - - - - - - -
GoalDescription
xdoc - The default goal. This goal simply executes the - xdoc:generate-from-pom - and xdoc:transform goals -
xdoc:generate-from-pom - Generate a set of reports from your project.xml file. - This includes the dependency, mailing list, project info, project - reports and team list pages -
init-dvsl-tag - This goal defines the DVSL tag library for generating - documentation. A single tag dvsl:dvsl is defined. -
-
+ + + + xdoc + + The default goal. This goal simply executes the + xdoc:generate-from-pom + and xdoc:transform goals + + + + xdoc:generate-from-pom + + Generate a set of reports from your project.xml file. + This includes the dependency, mailing list, project info, project + reports and team list pages + + + + init-dvsl-tag + + This goal defines the DVSL tag library for generating + documentation. A single tag dvsl:dvsl is defined. + + + + - + \ No newline at end of file