Author: vsiveton
Date: Sat May  5 07:09:00 2007
New Revision: 535524

URL: http://svn.apache.org/viewvc?view=rev&rev=535524
Log:
MJAVADOC-120: Better handling of Javadoc resources: overview.html, doc-files

o bumped to plexus-utils:1.4.1
o copy /src/main/javadoc/**/doc-files to the output directory
o autodetect the overview in the /src/main/javadoc directory
o added test case
o improved documentation

Added:
    
maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/javadoc-resources.apt
   (with props)
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java
   (with props)
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/resources-test-plugin-config.xml
   (with props)
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test/App.java
   (with props)
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test2/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test2/App2.java
   (with props)
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/javadoc/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/javadoc/resources/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/javadoc/resources/test/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/javadoc/resources/test/doc-files/
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/javadoc/resources/test/doc-files/maven-feather.png
   (with props)
Modified:
    maven/plugins/trunk/maven-javadoc-plugin/pom.xml
    
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
    maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/index.apt
    maven/plugins/trunk/maven-javadoc-plugin/src/site/fml/faq.fml
    maven/plugins/trunk/maven-javadoc-plugin/src/site/site.xml
    
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/JavadocReportTest.java

Modified: maven/plugins/trunk/maven-javadoc-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/pom.xml?view=diff&rev=535524&r1=535523&r2=535524
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/pom.xml Sat May  5 07:09:00 2007
@@ -67,8 +67,7 @@
       <artifactId>maven-project</artifactId>
       <version>2.0.2</version>
       <exclusions>
-                <!-- Using org.codehaus.plexus:plexus-utils instead of 
-        -->
+        <!-- Using org.codehaus.plexus:plexus-utils instead of -->
         <exclusion>
           <groupId>plexus</groupId>
           <artifactId>plexus-utils</artifactId>
@@ -80,8 +79,7 @@
       <artifactId>maven-plugin-api</artifactId>
       <version>2.0.2</version>
       <exclusions>
-                <!-- Using org.codehaus.plexus:plexus-utils instead of 
-        -->
+        <!-- Using org.codehaus.plexus:plexus-utils instead of -->
         <exclusion>
           <groupId>plexus</groupId>
           <artifactId>plexus-utils</artifactId>
@@ -91,15 +89,14 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>1.2</version>
+      <version>1.4.1</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-impl</artifactId>
       <version>2.0.2</version>
       <exclusions>
-                <!-- Using org.codehaus.plexus:plexus-utils instead of 
-        -->
+        <!-- Using org.codehaus.plexus:plexus-utils instead of -->
         <exclusion>
           <groupId>plexus</groupId>
           <artifactId>plexus-utils</artifactId>
@@ -124,4 +121,3 @@
     </dependency>
   </dependencies>
 </project>
-

Modified: 
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java?view=diff&rev=535524&r1=535523&r2=535524
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
 Sat May  5 07:09:00 2007
@@ -367,7 +367,7 @@
      * <br/>
      * See <a 
href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#overview";>overview</a>.
      *
-     * @parameter expression="${overview}"
+     * @parameter expression="${overview}" 
default-value="${basedir}/src/main/javadoc/overview.html"
      */
     private String overview;
 
@@ -957,6 +957,19 @@
         }
 
         // 
----------------------------------------------------------------------
+        // Copy javadoc resources
+        // 
----------------------------------------------------------------------
+
+        try
+        {
+            copyJavadocResources( javadocOutputDirectory );
+        }
+        catch ( IOException e )
+        {
+            throw new MavenReportException( "Unable to copy javadoc resources: 
" + e.getMessage(), e );
+        }
+
+        // 
----------------------------------------------------------------------
         // Wrap javadoc options
         // 
----------------------------------------------------------------------
 
@@ -1023,7 +1036,10 @@
             addArgIf( arguments, old, "-1.1" );
         }
 
-        addArgIfNotEmpty( arguments, "-overview", quotedPathArgument( overview 
) );
+        if ( ( StringUtils.isNotEmpty( overview ) ) && ( new File( overview 
).exists() ) )
+        {
+            addArgIfNotEmpty( arguments, "-overview", quotedPathArgument( 
overview ) );
+        }
         arguments.add( getAccessLevel() );
         addArgIf( arguments, quiet, "-quiet", SINCE_JAVADOC_1_4 );
         addArgIfNotEmpty( arguments, "-source", quotedArgument( source ), 
SINCE_JAVADOC_1_4 );
@@ -2202,8 +2218,41 @@
     }
 
     /**
-     * Method that indicates whether the javadoc can be generated or not. If 
the project does not contain
-     * any source files and no subpackages are specified, the plugin will 
terminate.
+     * Convenience method that copy all <code>doc-files</code> directories 
from <code>javadocDirectory</code>
+     * to the specified output directory.
+     *
+     * @see <a 
href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/whatsnew-1.2.html#docfiles";>Reference
+     * Guide, Copies new "doc-files" directory for holding images and 
examples</a>
+     *
+     * @param outputDirectory the output directory
+     * @throws java.io.IOException if any
+     */
+    private void copyJavadocResources( File outputDirectory ) throws 
IOException
+    {
+        if ( javadocDirectory == null )
+        {
+            return;
+        }
+
+        File javadocDir = new File( javadocDirectory );
+        if ( javadocDir.exists() && javadocDir.isDirectory() )
+        {
+            List docFiles =
+                FileUtils.getDirectoryNames( new File( javadocDirectory ), 
"**/doc-files", null, false, true );
+            for ( Iterator it = docFiles.iterator(); it.hasNext(); )
+            {
+                String docFile = (String) it.next();
+
+                File docFileOutput = new File( getOutputDirectory(), docFile );
+                FileUtils.mkdir( docFileOutput.getAbsolutePath() );
+                FileUtils.copyDirectory( new File( javadocDirectory, docFile 
), docFileOutput );
+            }
+        }
+    }
+
+    /**
+     * Method that indicates whether the javadoc can be generated or not. If 
the project does not contain any source
+     * files and no subpackages are specified, the plugin will terminate.
      *
      * @param files the project files
      * @return a boolean that indicates whether javadoc report can be 
generated or not

Added: 
maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/javadoc-resources.apt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/javadoc-resources.apt?view=auto&rev=535524
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/javadoc-resources.apt
 (added)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/javadoc-resources.apt
 Sat May  5 07:09:00 2007
@@ -0,0 +1,162 @@
+ ------
+ Using Javadoc Resources
+ ------
+ Vincent Siveton
+ ------
+ Mai 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements.  See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership.  The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License.  You may obtain a copy of the License at
+~~
+~~   http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied.  See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
+Using Javadoc Resources
+
+ The \<javadocDirectory/\> parameter can be used to include Javadoc resources 
like HTML or images. By default, all
+ javadoc resources are in <$\{basedir\}/src/main/javadoc> directory.
+
+ Here is a typical set of resources files used by the Maven Javadoc plugin:
+
++-----+
+
+yourproject
+  |-- src
+    |-- main
+      |-- java
+        |-- org
+          |-- apache
+            |-- test
+              `-- App.java
+              `-- package-info.java
+      |-- javadoc
+        `-- overview.html
+        |-- org
+          |-- apache
+            |-- test
+              `-- package.html
+              |-- doc-files
+                `-- app.png
++-----+
+
+* Overview comment files: <overview.html>
+
+ These contain comments about the set of packages. The <overview.html> is a 
general documentation that applies to
+ the entire application or set of packages.
+
+ For more information, see 
{{{http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#overviewcomment}
+ javadoc - The Java API Documentation Generator, Overview Comment File}}.
+
+ Here is an example of an <overview.html> file, located in 
<$\{basedir\}/src/main/javadoc/overview.html>:
+
++-----+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+  <HEAD>
+    <TITLE>API Overview</TITLE>
+  </HEAD>
+  <BODY>
+    Short overview of the API.
+  </BODY>
+</HTML>
++-----+
+
+ By default, the Javadoc Plugin includes the 
<$\{basedir\}/src/main/javadoc/overview.html> if it exists. You could also
+ specify a specific <overview> file with the \<overview/\> parameter, for 
instance:
+
++-----+
+<project>
+  ...
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          ...
+          <overview>${basedir}/overview.html</overview>
+          ...
+        </configuration>
+      </plugin>
+    </plugins>
+    ...
+  </reporting>
+  ...
+</project>
++-----+
+
+* Package comment files: <package.html>
+
+ These contain package comments. The <package.html> is a brief summary of each 
packages in the list of all packages.
+
+ For more information, see 
{{{http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#packagecomment}
+ javadoc - The Java API Documentation Generator, Package Comment Files}} and
+ 
{{{http://java.sun.com/j2se/javadoc/writingdoccomments/index.html#packagecomments}
+ How to Write Doc Comments for the Javadoc Tool, Package-Level Comments}}.
+
+ Here is an example of a <package.html> file, located in 
<$\{basedir\}/src/main/javadoc/org/apache/test/package.html>:
+
++-----+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+  <HEAD>
+    <TITLE>Core Package</TITLE>
+  </HEAD>
+  <BODY>
+    This is the core package of the application
+    @since 1.0
+  </BODY>
+</HTML>
++-----+
+
+ <<Note:>> With Javadoc 5.0, this file becomes <package-info.java> and is 
preferred over <package.html>.
+
+ For more information, see 
{{{http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#packagecomment}
+ javadoc - The Java API Documentation Generator, Package Comment Files}}.
+
+ Here is an example of a <package-info.java> file, located in 
<$\{basedir\}/src/main/java/org/apache/test/package-info.java>:
+
++-----+
+/**
+ * This is the core package for the application
+ * @since 1.0
+ */
+package org.apache.test;
++-----+
+
+* Miscellaneous Unprocessed Files: <doc-files>
+
+ These include images, sample source code, class files, applets, HTML files...
+
+ For more information, see 
{{{http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#unprocessed}
+ javadoc - The Java API Documentation Generator, Miscellaneous Unprocessed 
Files}} and 
{{{http://java.sun.com/j2se/javadoc/writingdoccomments/index.html#images}
+ How to Write Doc Comments for the Javadoc Tool, Including Images }}.
+
+ Here is a sample javadoc comment to use images, located in 
<$\{basedir\}/src/main/javadoc/org/apache/test/doc-files> directory:
+
++-----+
+package org.apache.test;
+
+/**
+ * The main Class launches the application.
+ * <img src="doc-files/app.png" alt="Example of the application GUI"/>
+ */
+public class App
+{
+}
++-----+

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/javadoc-resources.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/examples/javadoc-resources.apt
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/index.apt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/index.apt?view=diff&rev=535524&r1=535523&r2=535524
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/index.apt (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/site/apt/index.apt Sat May  5 
07:09:00 2007
@@ -78,3 +78,5 @@
    * {{{examples/tag-configuration.html}Configuring Custom Javadoc Tags}}
 
    * {{{examples/taglet-configuration.html}Configuring Custom Javadoc Taglet}}
+
+   * {{{examples/javadoc-resources.html}Using Javadoc Resources}}

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/site/fml/faq.fml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/site/fml/faq.fml?view=diff&rev=535524&r1=535523&r2=535524
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/site/fml/faq.fml (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/site/fml/faq.fml Sat May  5 
07:09:00 2007
@@ -30,7 +30,7 @@
         </p>
       </answer>
     </faq>
-    <faq id="Where do I put javadoc resources like package.html">
+    <faq id="Where do I put javadoc resources like HTML files or images">
       <question>Where do I put Javadoc resources like HTML files or 
images?</question>
       <answer>
         <p>
@@ -38,21 +38,8 @@
           <i>${basedir}/src/main/javadoc</i> directory.
         </p>
         <p>
-          Here is the directory layout expected by Maven Javadoc Plugin:
+          See <a href="examples/javadoc-resources.html">Using Javadoc 
Resources</a> for more information.
         </p>
-        <source>
-yourproject
-  |-- src
-    |-- main
-      |-- java
-        |-- org
-          |...
-            `-- MyClass.java
-      |-- javadoc
-        |-- org
-          |...
-            `-- package.html
-        </source>
       </answer>
     </faq>
     <faq id="How to know exactly the Javadoc command line">

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/site/site.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/site/site.xml?view=diff&rev=535524&r1=535523&r2=535524
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/site/site.xml (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/site/site.xml Sat May  5 
07:09:00 2007
@@ -39,6 +39,7 @@
       <item name="Configuring Stylesheets" 
href="/examples/stylesheet-configuration.html"/>
       <item name="Configuring Custom Tags" 
href="/examples/tag-configuration.html"/>
       <item name="Configuring Custom Taglets" 
href="/examples/taglet-configuration.html"/>
+      <item name="Using Javadoc Resources" 
href="/examples/javadoc-resources.html"/>
     </menu>
   </body>
 </project>

Modified: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/JavadocReportTest.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/JavadocReportTest.java?view=diff&rev=535524&r1=535523&r2=535524
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/JavadocReportTest.java
 (original)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/JavadocReportTest.java
 Sat May  5 07:09:00 2007
@@ -267,7 +267,7 @@
         assertTrue( str.toLowerCase().indexOf(
                                                
"HREF=\"http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html";
                                                    .toLowerCase() ) != -1 );
-        
+
         //header
         assertTrue( str.toUpperCase().indexOf( "MAVEN JAVADOC PLUGIN TEST" ) 
!= -1 );
 
@@ -545,7 +545,7 @@
      * @return a String object that contains the contents of the file
      * @throws IOException
      */
-    private String readFile( File file )
+    private static String readFile( File file )
         throws IOException
     {
         String str = "", strTmp = "";
@@ -638,5 +638,38 @@
         mojo.execute();
 
         System.setProperty( "java.home", oldJreHome );
+    }
+
+    /**
+     * Test the javadoc resources.
+     *
+     * @throws Exception
+     */
+    public void testJavadocResources() throws Exception
+    {
+        File testPom =
+            new File( getBasedir(), 
"src/test/resources/unit/resources-test/resources-test-plugin-config.xml" );
+        JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
+        mojo.execute();
+
+        File app =
+            new File( getBasedir(), 
"target/test/unit/resources-test/target/site/apidocs/resources/test/App.html" );
+        assertTrue( FileUtils.fileExists( app.getAbsolutePath() ) );
+        String readed = readFile( app );
+        assertTrue( readed.indexOf( "<img src=\"doc-files/maven-feather.png\" 
alt=\"Maven\"/>" ) != -1 );
+        File feather =
+            new File( getBasedir(),
+                      
"target/test/unit/resources-test/target/site/apidocs/resources/test/doc-files/maven-feather.png"
 );
+        assertTrue( FileUtils.fileExists( feather.getAbsolutePath() ) );
+
+        File app2 =
+            new File( getBasedir(), 
"target/test/unit/resources-test/target/site/apidocs/resources/test2/App2.html" 
);
+        assertTrue( FileUtils.fileExists( app2.getAbsolutePath() ) );
+        readed = readFile( app2 );
+        assertTrue( readed.indexOf( "<img src=\"doc-files/maven-feather.png\" 
alt=\"Maven\"/>" ) != -1 );
+        File feather2 =
+            new File( getBasedir(),
+                      
"target/test/unit/resources-test/target/site/apidocs/resources/test2/doc-files/maven-feather.png"
 );
+        assertFalse( FileUtils.fileExists( feather2.getAbsolutePath() ) );
     }
 }

Added: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java?view=auto&rev=535524
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java
 (added)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java
 Sat May  5 07:09:00 2007
@@ -0,0 +1,96 @@
+package org.apache.maven.plugin.javadoc.stubs;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.model.Build;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+
+import java.io.File;
+import java.io.FileReader;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Siveton</a>
+ */
+public class ResourcesTestMavenProjectStub extends MavenProjectStub
+{
+    private Build build;
+
+    public ResourcesTestMavenProjectStub()
+    {
+        MavenXpp3Reader pomReader = new MavenXpp3Reader();
+        Model model = null;
+
+        try
+        {
+            model =
+                pomReader.read( new FileReader( new File( getBasedir(), 
"resources-test-plugin-config.xml" ) ) );
+            setModel( model );
+        }
+        catch ( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+
+        setGroupId( model.getGroupId() );
+        setArtifactId( model.getArtifactId() );
+        setVersion( model.getVersion() );
+        setName( model.getName() );
+        setUrl( model.getUrl() );
+        setPackaging( model.getPackaging() );
+
+        Build build = new Build();
+        build.setFinalName( model.getArtifactId() );
+        build.setSourceDirectory( getBasedir() + "/src/main/java" );
+        build.setDirectory( super.getBasedir() + 
"/target/test/unit/resources-test/target" );
+        setBuild( build );
+
+        List compileSourceRoots = new ArrayList();
+        compileSourceRoots.add( getBasedir() + "/src/main/java" );
+        setCompileSourceRoots( compileSourceRoots );
+    }
+
+    /**
+     * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getBuild()
+     */
+    public Build getBuild()
+    {
+        return build;
+    }
+
+    /**
+     * @see 
org.apache.maven.plugin.testing.stubs.MavenProjectStub#setBuild(org.apache.maven.model.Build)
+     */
+    public void setBuild( Build build )
+    {
+        this.build = build;
+    }
+
+    /**
+     * @see org.apache.maven.plugin.testing.stubs.MavenProjectStub#getBasedir()
+     */
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + 
"/src/test/resources/unit/resources-test" );
+    }
+}

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/ResourcesTestMavenProjectStub.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/resources-test-plugin-config.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/resources-test-plugin-config.xml?view=auto&rev=535524
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/resources-test-plugin-config.xml
 (added)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/resources-test-plugin-config.xml
 Sat May  5 07:09:00 2007
@@ -0,0 +1,44 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>resources.test</groupId>
+  <artifactId>resources-test</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <inceptionYear>2007</inceptionYear>
+  <name>Maven Javadoc Plugin resources Test</name>
+  <url>http://maven.apache.org</url>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <project 
implementation="org.apache.maven.plugin.javadoc.stubs.ResourcesTestMavenProjectStub"/>
+          <localRepository>${localRepository}</localRepository>
+          
<outputDirectory>${basedir}/target/test/unit/resources-test/target/site/apidocs</outputDirectory>
+          <windowtitle>Maven Javadoc Plugin resources 1.0-SNAPSHOT 
API</windowtitle>
+          
<javadocDirectory>${basedir}/src/test/resources/unit/resources-test/src/main/javadoc</javadocDirectory>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/resources-test-plugin-config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/resources-test-plugin-config.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test/App.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test/App.java?view=auto&rev=535524
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test/App.java
 (added)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test/App.java
 Sat May  5 07:09:00 2007
@@ -0,0 +1,49 @@
+package resources.test;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Sample class inside the package to be included in the javadoc
+ * <img src="doc-files/maven-feather.png" alt="Maven"/>
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Siveton</a>
+ */
+public class App
+{
+    /**
+     * The main method
+     *
+     * @param args  an array of strings that contains the arguments
+     */
+    public static void main( String[] args )
+    {
+        System.out.println( "Sample Application." );
+    }
+
+    /**
+     * Sample method that prints out the parameter string.
+     *
+     * @param str   The string value to be printed.
+     */
+    protected void sampleMethod( String str )
+    {
+        System.out.println( str );
+    }
+}

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test/App.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test/App.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test2/App2.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test2/App2.java?view=auto&rev=535524
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test2/App2.java
 (added)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test2/App2.java
 Sat May  5 07:09:00 2007
@@ -0,0 +1,49 @@
+package resources.test2;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Sample class inside the package to be included in the javadoc
+ * <img src="doc-files/maven-feather.png" alt="Maven"/>
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Siveton</a>
+ */
+public class App2
+{
+    /**
+     * The main method
+     *
+     * @param args  an array of strings that contains the arguments
+     */
+    public static void main( String[] args )
+    {
+        System.out.println( "Sample Application." );
+    }
+
+    /**
+     * Sample method that prints out the parameter string.
+     *
+     * @param str   The string value to be printed.
+     */
+    protected void sampleMethod( String str )
+    {
+        System.out.println( str );
+    }
+}

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test2/App2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/java/resources/test2/App2.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/javadoc/resources/test/doc-files/maven-feather.png
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/javadoc/resources/test/doc-files/maven-feather.png?view=auto&rev=535524
==============================================================================
Binary file - no diff available.

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/resources-test/src/main/javadoc/resources/test/doc-files/maven-feather.png
------------------------------------------------------------------------------
    svn:mime-type = image/png


Reply via email to