maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r382000 - in /maven/plugins/trunk/maven-javadoc-plugin: ./ src/main/java/org/apache/maven/plugin/javadoc/ src/main/mdo/ src/site/apt/ src/test/projects/javadoc-plugin-test1/
Date Wed, 01 Mar 2006 12:15:50 GMT
Author: vsiveton
Date: Wed Mar  1 04:15:46 2006
New Revision: 382000

URL: http://svn.apache.org/viewcvs?rev=382000&view=rev
Log:
PR: MJAVADOC-8 <group> parameter seems hard to use
Refactored the group option
Updated documentation and tests. 

Added:
    maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/
    maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/javadocOptions.mdo
Modified:
    maven/plugins/trunk/maven-javadoc-plugin/pom.xml
    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/configuration.apt
    maven/plugins/trunk/maven-javadoc-plugin/src/test/projects/javadoc-plugin-test1/pom.xml

Modified: maven/plugins/trunk/maven-javadoc-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-javadoc-plugin/pom.xml?rev=382000&r1=381999&r2=382000&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/pom.xml Wed Mar  1 04:15:46 2006
@@ -30,6 +30,26 @@
       <timezone>-5</timezone>
     </developer>
   </developers>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.modello</groupId>
+        <artifactId>modello-maven-plugin</artifactId>
+        <version>1.0-alpha-8</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>java</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <version>1.0.0</version>
+          <model>src/main/mdo/javadocOptions.mdo</model>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
   <dependencies>
     <dependency>
       <groupId>commons-lang</groupId>

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocReport.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocReport.java?rev=382000&r1=381999&r2=382000&view=diff
==============================================================================
--- 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
Wed Mar  1 04:15:46 2006
@@ -33,6 +33,7 @@
 import org.apache.maven.artifact.DependencyResolutionRequiredException;
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.model.Model;
+import org.apache.maven.plugin.javadoc.options.Group;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.reporting.AbstractMavenReport;
 import org.apache.maven.reporting.MavenReportException;
@@ -211,7 +212,7 @@
 
     /**
      * Specifies the access level for classes and members to show in the Javadocs.
-     * Possible values are: 
+     * Possible values are:
      * <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#public">public</a>
      *      (shows only public classes and members),
      * <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#protected">protected</a>
@@ -220,7 +221,7 @@
      *      (shows all classes and members not marked private), and
      * <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#private">private</a>
      *      (shows all classes and members).
-     * 
+     *
      * @parameter expression="${show}" default-value="protected"
      */
     private String show = "protected";
@@ -323,9 +324,9 @@
      * See <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#group">group</a>.
      * It is a comma separated String.
      *
-     * @parameter expression="${group}"
+     * @parameter expression="${groups}"
      */
-    private String group;
+    private Group[] groups;
 
     /**
      * Specifies the header text to be placed at the top of each output file.
@@ -819,15 +820,15 @@
 
             bottom = StringUtils.replace( bottom, "{currentYear}", year );
 
-            if ( model != null  && model.getInceptionYear() != null )
+            if ( model != null && model.getInceptionYear() != null )
             {
                 if ( model.getInceptionYear().equals( year ) )
                 {
-                    bottom = StringUtils.replace( bottom, "{inceptionYear}-", "" );     
          
+                    bottom = StringUtils.replace( bottom, "{inceptionYear}-", "" );
                 }
                 else
                 {
-                    bottom = StringUtils.replace( bottom, "{inceptionYear}", model.getInceptionYear()
);                
+                    bottom = StringUtils.replace( bottom, "{inceptionYear}", model.getInceptionYear()
);
                 }
             }
 
@@ -847,7 +848,17 @@
             addArgIfNotEmpty( arguments, "-doctitle", quotedArgument( doctitle ) );
             addArgIfNotEmpty( arguments, "-excludedocfilessubdir", quotedPathArgument( excludedocfilessubdir
), 1.4f );
             addArgIfNotEmpty( arguments, "-footer", quotedArgument( footer ) );
-            addArgIfNotEmpty( arguments, "-group", quotedArgument( group ), true );
+            for ( int i = 0; i < groups.length; i++ )
+            {
+                if ( ( groups[i] == null ) || ( StringUtils.isEmpty( groups[i].getTitle()
) )
+                    || ( StringUtils.isEmpty( groups[i].getPackages() ) ) )
+                {
+                    getLog().info( "A group option is empty. Ignore this option." );
+                    continue;
+                }
+                addArgIfNotEmpty( arguments, "-group", quotedArgument( groups[i].getTitle()
) + " "
+                    + quotedArgument( groups[i].getPackages() ), true );
+            }
             addArgIfNotEmpty( arguments, "-header", quotedArgument( header ) );
             addArgIfNotEmpty( arguments, "-helpfile", quotedPathArgument( helpfile ) );
 

Added: maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/javadocOptions.mdo
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/javadocOptions.mdo?rev=382000&view=auto
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/javadocOptions.mdo (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/javadocOptions.mdo Wed Mar  1 04:15:46
2006
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+
+<model>
+  <id>javadocoptions</id>
+  <name>JavadocOptions</name>
+  <description><![CDATA[Model for Javadoc Options.]]></description>
+  <defaults>
+    <default>
+      <key>package</key>
+      <value>org.apache.maven.plugin.javadoc.options</value>
+    </default>
+  </defaults>
+  <classes>
+    <class>
+      <name>Group</name>
+      <description>A Group parameter.</description>
+      <version>1.0.0</version>
+      <fields>
+        <field>
+          <name>title</name>
+          <description>Title can be any text, and can include white space. This text
is placed in the table heading for the group.</description>
+          <version>1.0.0</version>
+          <type>String</type>
+          <identifier>true</identifier>
+        </field>
+        <field>
+          <name>packages</name>
+          <description>Packages can be any package name, or can be the start of any
package name followed by an asterisk (*). The asterisk is a wildcard meaning "match any characters".
This is the only wildcard allowed. Multiple patterns can be included in a group by separating
them with colons (:).</description>
+          <version>1.0.0</version>
+          <type>String</type>
+          <identifier>true</identifier>
+        </field>
+      </fields>
+    </class>
+  </classes>
+</model>
+

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/configuration.apt
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/configuration.apt?rev=382000&r1=381999&r2=382000&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/configuration.apt (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/configuration.apt Wed Mar  1 04:15:46
2006
@@ -3,13 +3,13 @@
  ------
  Vincent Siveton
  ------
- 10 July 2005
+ 01 March 2005
  ------
-
+
 
 Javadoc Plugin Configuration
 
- To generate the project javadocs as part of the site generation, add configuration 
+ To generate the project javadocs as part of the site generation, add configuration
  similar to the following to your POM:
 
 -------------------
@@ -35,7 +35,7 @@
 
   The configuration within <reporting> is not used when javadoc is explicitly invoked
   via 'mvn javadoc:javadoc'.  To configure explicit invocation, use the <build> element
instead:
-  
+
 -------------------
 <project>
   ...
@@ -56,3 +56,39 @@
   ...
 </project>
 -------------------
+
+Specific configuration for some Javadoc options
+
+ Some Javadoc options have a specific configuration. Add similar configuration to your POM:
+
+*group
+
+-------------------
+<project>
+  ...
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <groups>
+            <group>
+              <title>Core Packages</title>
+              <packages>org.apache.maven.plugin.javadoc.test1</packages>
+            </group>
+            <group>
+              <title>Extension Packages</title>
+              <packages>org.apache.maven.plugin.javadoc.test2</packages>
+            </group>
+          </groups>
+          ...
+        </configuration>
+      </plugin>
+    </plugins>
+  ...
+  </build>
+  ...
+</project>
+-------------------
+

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/projects/javadoc-plugin-test1/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-javadoc-plugin/src/test/projects/javadoc-plugin-test1/pom.xml?rev=382000&r1=381999&r2=382000&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/projects/javadoc-plugin-test1/pom.xml
(original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/projects/javadoc-plugin-test1/pom.xml
Wed Mar  1 04:15:46 2006
@@ -57,7 +57,16 @@
           <bottom>Copyright me</bottom>
           <source>true</source>
           <link>http://java.sun.com/j2se/1.4.2/docs/api, http://maven.apache.org/apidocs/</link>
-          <group>"Core Packages" "org.apache.maven.plugin.javadoc.test1", "Extension
Packages" "org.apache.maven.plugin.javadoc.test2"</group>
+          <groups>
+          	<group>
+          	  <title>Core Packages</title>
+          	  <packages>org.apache.maven.plugin.javadoc.test1</packages>
+          	</group>
+          	<group>
+          	  <title>Extension Packages</title>
+          	  <packages>org.apache.maven.plugin.javadoc.test2</packages>
+          	</group>
+          </groups>
           <tag>.usage:a:Usage:, .todo:a:To do something:, .fixme:a:Fixme:</tag>
         </configuration>
       </plugin>



Mime
View raw message