You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2006/09/04 14:41:43 UTC

svn commit: r440055 - in /maven/plugins/trunk/maven-javadoc-plugin/src: main/java/org/apache/maven/plugin/javadoc/JavadocReport.java site/apt/examples/alternate-doclet.apt

Author: vsiveton
Date: Mon Sep  4 05:41:43 2006
New Revision: 440055

URL: http://svn.apache.org/viewvc?view=rev&rev=440055
Log:
MJAVADOC-81: Additional doclets do not run.
Submitted by: Shinobu Kawai 
Reviewed by: Vincent Siveton

Applied with a small change
o Using destDir instead of outputName
o Updated documentation according new changes

Modified:
    maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocReport.java
    maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/alternate-doclet.apt

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocReport.java?view=diff&rev=440055&r1=440054&r2=440055
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocReport.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocReport.java Mon Sep  4 05:41:43 2006
@@ -21,7 +21,6 @@
 import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
 import org.apache.maven.reporting.MavenReport;
 import org.apache.maven.reporting.MavenReportException;
 import org.codehaus.doxia.sink.Sink;
@@ -61,11 +60,32 @@
     /**
      * Specifies the destination directory where javadoc saves the generated HTML files.
      *
-     * @parameter expression="${project.reporting.outputDirectory}/apidocs"
+     * @parameter expression="${project.reporting.outputDirectory}/${destDir}"
      * @required
      */
     private File reportOutputDirectory;
 
+    /**
+     * The name of the destination directory.
+     *
+     * @parameter expression="${destDir}" default-value="apidocs"
+     */
+    private String destDir;
+
+    /**
+     * The name of the javadoc report.
+     *
+     * @parameter expression="${name}" default-value="JavaDocs"
+     */
+    private String name;
+
+    /**
+     * The description of the javadoc report.
+     *
+     * @parameter expression="${description}" default-value="JavaDoc API documentation."
+     */
+    private String description;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -75,7 +95,7 @@
      */
     public String getName( Locale locale )
     {
-        return "JavaDocs";
+        return name;
     }
 
     /**
@@ -83,24 +103,7 @@
      */
     public String getDescription( Locale locale )
     {
-        // TODO i18n
-        return "JavaDoc API documentation.";
-    }
-
-    /**
-     * @see org.apache.maven.reporting.AbstractMavenReport#getProject()
-     */
-    protected MavenProject getProject()
-    {
-        return project;
-    }
-
-    /**
-     * @see org.apache.maven.reporting.AbstractMavenReport#getSiteRenderer()
-     */
-    protected Renderer getSiteRenderer()
-    {
-        return siteRenderer;
+        return description;
     }
 
     /**
@@ -110,6 +113,7 @@
         throws MavenReportException
     {
         outputDirectory = getReportOutputDirectory();
+
         executeReport( locale );
     }
 
@@ -118,7 +122,7 @@
      */
     public String getOutputName()
     {
-        return "apidocs/index";
+        return destDir + "/index";
     }
 
     /**
@@ -178,9 +182,9 @@
      */
     public void setReportOutputDirectory( File reportOutputDirectory )
     {
-        if ( ( reportOutputDirectory != null ) && ( !reportOutputDirectory.getAbsolutePath().endsWith( "apidocs" ) ) )
+        if ( ( reportOutputDirectory != null ) && ( !reportOutputDirectory.getAbsolutePath().endsWith( destDir ) ) )
         {
-            this.reportOutputDirectory = new File( reportOutputDirectory, "apidocs" );
+            this.reportOutputDirectory = new File( reportOutputDirectory, destDir );
         }
         else
         {

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/alternate-doclet.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/alternate-doclet.apt?view=diff&rev=440055&r1=440054&r2=440055
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/alternate-doclet.apt (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/alternate-doclet.apt Mon Sep  4 05:41:43 2006
@@ -4,9 +4,9 @@
  Vincent Siveton
  Maria Odea Ching
  ------
- June 2006
+ September 2006
  ------
- 
+
  ~~ Copyright 2006 The Apache Software Foundation.
  ~~
  ~~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,8 +27,11 @@
 
 Using Alternate Doclet
 
- To generate output from an alternate doclet in addition to the project javadocs, add configuration
- similar to the following to your POM:
+ To generate output from an alternate doclet, add configuration similar to the following to your POM.
+
+ In this example, the doclet is UmlGraph. UmlGraph allows the declarative specification and drawing
+ of UML class and sequence diagrams.
+ For more information about UmlGraph, please refer to {{http://www.spinellis.gr/sw/umlgraph/}}.
 
 +-----+
 <project>
@@ -40,13 +43,14 @@
             <artifactId>maven-javadoc-plugin</artifactId>
             <configuration>
               <doclet>gr.spinellis.umlgraph.doclet.UmlGraph</doclet>
+
+              <!-- <docletPath>/path/to/UmlGraph.jar</docletPath> -->
               <docletArtifact>
-                <groupId>umlgraph</groupId>
-                <artifactId>UMLGraph</artifactId>
+                <groupId>gr.spinellis</groupId>
+                <artifactId>UmlGraph</artifactId>
                 <version>4.4</version>
               </docletArtifact>
               <additionalparam>-views</additionalparam>
-              <destDir>target/uml</destDir>
             </configuration>
          </plugin>
          ...
@@ -56,4 +60,71 @@
 </project>
 +-----+
 
- After executing <<<mvn site>>>, you will see that a UML graph (.dot file) will be generated in the specified <<<destDir>>>.
\ No newline at end of file
+ <<Note>>: \<additionalparam/\> is used to set additional parameters on the command line, specifically
+ for doclet options.
+
+ After executing <<<mvn site>>>, you will see that a UML graph (.dot file) will be generated in the
+ destination directory.
+
+ <<Note>>: You must have the Graphviz binary on your PATH, or the images will not be generated.
+ For more information about Graphviz, please refer to {{http://www.graphviz.org/}}.
+
+Using Alternate Doclet in Addition to the Javadoc Doclet
+
+ To generate output from an alternate doclet in addition to the normal HTML Javadoc doclet, add configuration
+ similar to the following to your POM.
+
+ In this example, the doclet is Sun DocCheck. The Sun Doc Check Doclet is an extension to the Javadoc
+ tool. It runs on source code and reviews documentation comments, generating an HTML report that
+ identifies empty comments and other ommissions and irregularities in the documentation comments.
+ For more information about Sun DocCheck, please refer to {{http://java.sun.com/j2se/javadoc/doccheck/}}.
+
++-----+
+<project>
+   ...
+   <reporting>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-javadoc-plugin</artifactId>
+            <reportSets>
+              <reportSet>
+                <id>html</id>
+                <reports>
+                  <report>javadoc</report>
+                </reports>
+              </reportSet>
+              <reportSet>
+                <id>doccheck</id>
+                <configuration>
+                  <doclet>com.sun.tools.doclets.doccheck.DocCheck</doclet>
+
+                  <!--docletPath>/path/to/doccheck.jar</docletPath-->
+                  <docletArtifact>
+                    <groupId>com.sun.tools.doclets</groupId>
+                    <artifactId>doccheck</artifactId>
+                    <version>1.2b2</version>
+                  </docletArtifact>
+                  <additionalparam>
+                    -d ${project.build.directory}/site/doccheck
+                  </additionalparam>
+
+                  <!-- Other dir than apidocs -->
+                  <destDir>doccheck</destDir>
+
+                  <!-- For the project-reports page-->
+                  <name>DocCheck</name>
+                  <description>DocCheck documentation.</description>
+                </configuration>
+                <reports>
+                  <report>javadoc</report>
+                </reports>
+              </reportSet>
+            </reportSets>
+        </plugin>
+         ...
+      </plugins>
+   </reporting>
+   ...
+</project>
++-----+