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/27 13:45:11 UTC

svn commit: r450405 - in /maven/plugins/trunk/maven-javadoc-plugin: ./ src/main/java/org/apache/maven/plugin/javadoc/ src/test/java/org/apache/maven/plugin/javadoc/ src/test/java/org/apache/maven/plugin/javadoc/stubs/ src/test/resources/unit/javaHome-t...

Author: vsiveton
Date: Wed Sep 27 04:45:10 2006
New Revision: 450405

URL: http://svn.apache.org/viewvc?view=rev&rev=450405
Log:
MJAVADOC-92: Cant find javadoc.exe on windows in specific cases

o Updated AbstractJavadocMojo#getJavadocPath() to read "java.home" and JAVA_HOME env variable
o Improved exception messages
o Updated/added test cases
o Updated prerequisites to 2.0.1 
o Updated dependencies and using plexus-utils:1.2
o Tested install with Maven 2.0.1 and above

Added:
    maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/
    maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/
    maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/
    maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/App.java   (with props)
    maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/AppSample.java   (with props)
    maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml   (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/main/java/org/apache/maven/plugin/javadoc/JavadocJar.java
    maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocReport.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/JavadocReportTest.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject1TestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject2TestMavenProjectStub.java
    maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.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=450405&r1=450404&r2=450405
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/pom.xml Wed Sep 27 04:45:10 2006
@@ -1,17 +1,36 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<!--
+  ~ Copyright 2006 The Apache Software Foundation.
+  ~
+  ~ Licensed 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 xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <artifactId>maven-plugins</artifactId>
     <groupId>org.apache.maven.plugins</groupId>
-    <version>2-SNAPSHOT</version>
+    <version>4-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>maven-javadoc-plugin</artifactId>
   <packaging>maven-plugin</packaging>
   <name>Maven Javadoc Plugin</name>
   <description>
-    The Maven Javadoc Plugin is a plugin that uses the javadoc tool for generating javadocs for
-    the specified project.
+    The Maven Javadoc Plugin is a plugin that uses the javadoc tool for
+    generating javadocs for the specified project.
   </description>
   <version>2.1-SNAPSHOT</version>
   <issueManagement>
@@ -19,20 +38,15 @@
     <url>http://jira.codehaus.org/browse/MJAVADOC</url>
   </issueManagement>
   <inceptionYear>2004</inceptionYear>
-  <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-javadoc-plugin</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-javadoc-plugin</developerConnection>
-    <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin</url>
-  </scm>
   <prerequisites>
-    <maven>2.0</maven>
+    <maven>2.0.1</maven>
   </prerequisites>
   <build>
     <plugins>
       <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
-        <version>1.0-alpha-8</version>
+        <version>1.0-alpha-10</version>
         <executions>
           <execution>
             <goals>
@@ -50,23 +64,25 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-      <version>2.0</version>
+      <artifactId>maven-project</artifactId>
+      <version>2.0.1</version>
     </dependency>
     <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.1</version>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0.1</version>
+      <exclusions>
+        <!-- Using org.codehaus.plexus:plexus-utils instead of -->
+        <exclusion>
+          <groupId>plexus</groupId>
+          <artifactId>plexus-utils</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-archiver</artifactId>
-      <version>1.0-alpha-3</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
-      <version>2.0</version>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.2</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
@@ -74,14 +90,19 @@
       <version>2.0.2</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact</artifactId>
-      <version>2.0</version>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-archiver</artifactId>
+      <version>1.0-alpha-7</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-plugin-testing-harness</artifactId>
-      <version>1.0-beta-2-SNAPSHOT</version>
+      <version>1.0-beta-1</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

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=450405&r1=450404&r2=450405
==============================================================================
--- 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 Wed Sep 27 04:45:10 2006
@@ -28,6 +28,7 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 import java.util.StringTokenizer;
 
@@ -940,7 +941,7 @@
         }
         catch ( IOException e )
         {
-            throw new MavenReportException( "Unable to copy default stylesheet", e );
+            throw new MavenReportException( "Unable to copy default stylesheet: " + e.getMessage(), e );
         }
 
         // ----------------------------------------------------------------------
@@ -982,7 +983,14 @@
         List arguments = new ArrayList();
 
         cmd.setWorkingDirectory( javadocOutputDirectory.getAbsolutePath() );
-        cmd.setExecutable( getJavadocPath() );
+        try
+        {
+            cmd.setExecutable( getJavadocPath() );
+        }
+        catch ( IOException e )
+        {
+            throw new MavenReportException( "Unable to find javadoc command: " + e.getMessage(), e );
+        }
 
         // General javadoc arguments
         addArgIf( arguments, breakiterator, "-breakiterator", SINCE_JAVADOC_1_4 );
@@ -1041,7 +1049,7 @@
             addArgIfNotEmpty( arguments, "-excludedocfilessubdir", quotedPathArgument( excludedocfilessubdir ),
                               SINCE_JAVADOC_1_4 );
             addArgIfNotEmpty( arguments, "-footer", quotedArgument( footer ) );
-            if ( groups!= null )
+            if ( groups != null )
             {
                 for ( int i = 0; i < groups.length; i++ )
                 {
@@ -1087,7 +1095,8 @@
             addArgIf( arguments, serialwarn, "-serialwarn" );
             addArgIfNotEmpty( arguments, "-sourcetab", sourcetab, SINCE_JAVADOC_1_5 );
             addArgIf( arguments, splitindex, "-splitindex" );
-            addArgIfNotEmpty( arguments, "-stylesheetfile", quotedPathArgument( getStylesheetFile( javadocOutputDirectory ) ) );
+            addArgIfNotEmpty( arguments, "-stylesheetfile",
+                              quotedPathArgument( getStylesheetFile( javadocOutputDirectory ) ) );
 
             addArgIfNotEmpty( arguments, "-taglet", quotedArgument( taglet ), SINCE_JAVADOC_1_4 );
             if ( taglets != null )
@@ -1100,7 +1109,8 @@
                     }
                     else
                     {
-                        addArgIfNotEmpty( arguments, "-taglet", quotedArgument( taglets[i].getTagletClass() ), SINCE_JAVADOC_1_4 );
+                        addArgIfNotEmpty( arguments, "-taglet", quotedArgument( taglets[i].getTagletClass() ),
+                                          SINCE_JAVADOC_1_4 );
                     }
                 }
             }
@@ -1184,12 +1194,15 @@
 
             if ( exitCode != 0 )
             {
-                throw new MavenReportException( "Exit code: " + exitCode + " - " + err.getOutput() );
+                StringBuffer msg = new StringBuffer( "Exit code: " + exitCode + " - " + err.getOutput() );
+                msg.append( '\n' );
+                msg.append( "Command line was:" + Commandline.toString( cmd.getCommandline() ) );
+                throw new MavenReportException( msg.toString() );
             }
         }
         catch ( CommandLineException e )
         {
-            throw new MavenReportException( "Unable to execute javadoc command", e );
+            throw new MavenReportException( "Unable to execute javadoc command: " + e.getMessage(), e );
         }
 
         // ----------------------------------------------------------------------
@@ -1307,11 +1320,7 @@
             if ( javadocDirectory != null )
             {
                 File javadocDir = new File( javadocDirectory );
-                if ( !javadocDir.exists() || !javadocDir.isDirectory() )
-                {
-                    getLog().warn( "The file '" + javadocDirectory + "' doesn't exists or it is not a directory." );
-                }
-                else
+                if ( javadocDir.exists() && javadocDir.isDirectory() )
                 {
                     sourcePaths.add( javadocDirectory );
                 }
@@ -1662,8 +1671,9 @@
 
         if ( StringUtils.isEmpty( path.toString() ) )
         {
-            getLog().warn( "No docletpath option was found. Please review <docletpath/> or <docletArtifact/>" +
-                    " or <doclets/>." );
+            getLog().warn(
+                           "No docletpath option was found. Please review <docletpath/> or <docletArtifact/>"
+                               + " or <doclets/>." );
         }
 
         return path.toString();
@@ -1746,8 +1756,7 @@
             return "";
         }
 
-        Artifact artifact = factory.createArtifact( javadocArtifact.getGroupId(),
-                                                    javadocArtifact.getArtifactId(),
+        Artifact artifact = factory.createArtifact( javadocArtifact.getGroupId(), javadocArtifact.getArtifactId(),
                                                     javadocArtifact.getVersion(), "compile", "jar" );
         try
         {
@@ -1797,31 +1806,67 @@
     }
 
     /**
-     * Get the path of Javadoc tool depending the OS.
+     * Get the path of Javadoc tool depending the OS, the <code>java.home</code> system property and the
+     * <code>JAVA_HOME</code> environment variable
      *
      * @return the path of the Javadoc tool
+     * @throws IOException if not found
      */
     private String getJavadocPath()
+        throws IOException
     {
         String javadocCommand = "javadoc" + ( SystemUtils.IS_OS_WINDOWS ? ".exe" : "" );
 
         File javadocExe;
 
+        // ----------------------------------------------------------------------
+        // Try to find javadocExe from System.getProperty( "java.home" )
+        // By default, System.getProperty( "java.home" ) = JRE_HOME and JRE_HOME
+        // should be in the JDK_HOME
+        // ----------------------------------------------------------------------
+
         // For IBM's JDK 1.2
         if ( SystemUtils.IS_OS_AIX )
         {
-            javadocExe = new File( SystemUtils.getJavaHome() + "/../sh", javadocCommand );
+            javadocExe = new File( SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "sh",
+                                   javadocCommand );
         }
         else if ( SystemUtils.IS_OS_MAC_OSX )
         {
-            javadocExe = new File( SystemUtils.getJavaHome() + "/bin", javadocCommand );
+            javadocExe = new File( SystemUtils.getJavaHome() + File.separator + "bin", javadocCommand );
         }
         else
         {
-            javadocExe = new File( SystemUtils.getJavaHome() + "/../bin", javadocCommand );
+            javadocExe = new File( SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "bin",
+                                   javadocCommand );
         }
 
-        getLog().debug( "Javadoc executable=[" + javadocExe.getAbsolutePath() + "]" );
+        // ----------------------------------------------------------------------
+        // Try to find javadocExe from JAVA_HOME environment variable
+        // ----------------------------------------------------------------------
+
+        if ( !javadocExe.exists() || !javadocExe.isFile() )
+        {
+            Properties env = CommandLineUtils.getSystemEnvVars();
+            String javaHome = env.getProperty( "JAVA_HOME" );
+            if ( StringUtils.isEmpty( javaHome ) )
+            {
+                throw new IOException( "The environment variable JAVA_HOME is not correctly set." );
+            }
+            if ( ( !new File( javaHome ).exists() ) || ( !new File( javaHome ).isDirectory() ) )
+            {
+                throw new IOException( "The environment variable JAVA_HOME=" + javaHome + " doesn't exist or is "
+                    + "not a valid directory." );
+            }
+
+            javadocExe = new File( env.getProperty( "JAVA_HOME" ) + File.separator + "bin", javadocCommand );
+        }
+
+        if ( !javadocExe.exists() || !javadocExe.isFile() )
+        {
+            throw new IOException( "The javadoc executable '" + javadocExe + "' doesn't exist or is not a file. "
+                + "Verify the JAVA_HOME environment variable." );
+        }
 
         return javadocExe.getAbsolutePath();
     }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocJar.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocJar.java?view=diff&rev=450405&r1=450404&r2=450405
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocJar.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocJar.java Wed Sep 27 04:45:10 2006
@@ -62,7 +62,7 @@
 
     /**
      * Used for attaching the artifact in the project
-     * 
+     *
      * @component
      */
     private MavenProjectHelper projectHelper;
@@ -120,15 +120,15 @@
             }
             catch ( ArchiverException e )
             {
-                throw new MojoExecutionException( "Error while creating archive.", e );
+                throw new MojoExecutionException( "Error while creating archive:" + e.getMessage(), e );
             }
             catch ( IOException e )
             {
-                throw new MojoExecutionException( "Error while creating archive.", e );
+                throw new MojoExecutionException( "Error while creating archive:" + e.getMessage(), e );
             }
             catch ( MavenReportException e )
             {
-                throw new MojoExecutionException( "Error while creating archive.", e );
+                throw new MojoExecutionException( "Error while creating archive:" + e.getMessage(), e );
             }
         }
     }

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=450405&r1=450404&r2=450405
==============================================================================
--- 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 Sep 27 04:45:10 2006
@@ -218,17 +218,17 @@
         catch ( RendererException e )
         {
             throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH )
-                + " report generation.", e );
+                + " report generation:" + e.getMessage(), e );
         }
         catch ( IOException e )
         {
             throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH )
-                + " report generation.", e );
+                + " report generation:" + e.getMessage(), e );
         }
         catch ( MavenReportException e )
         {
             throw new MojoExecutionException( "An error has occurred in " + getName( Locale.ENGLISH )
-                + " report generation.", e );
+                + " report generation:" + e.getMessage(), e );
         }
     }
 }

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=450405&r1=450404&r2=450405
==============================================================================
--- 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 Wed Sep 27 04:45:10 2006
@@ -44,6 +44,15 @@
     }
 
     /**
+     * @see junit.framework.TestCase#tearDown()
+     */
+    protected void tearDown()
+        throws Exception
+    {
+        // nop
+    }
+
+    /**
      * Test when default configuration is provided for the plugin
      *
      * @throws Exception
@@ -99,36 +108,35 @@
                                   "target/test/unit/default-configuration/target/site/apidocs/allclasses-noframe.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/default-configuration/target/site/apidocs/constant-values.html" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/default-configuration/target/site/apidocs/constant-values.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/default-configuration/target/site/apidocs/deprecated-list.html" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/default-configuration/target/site/apidocs/deprecated-list.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/default-configuration/target/site/apidocs/help-doc.html" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/default-configuration/target/site/apidocs/help-doc.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/default-configuration/target/site/apidocs/index-all.html" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/default-configuration/target/site/apidocs/index-all.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/default-configuration/target/site/apidocs/index.html" );
+        generatedFile = new File( getBasedir(), "target/test/unit/default-configuration/target/site/apidocs/index.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/default-configuration/target/site/apidocs/overview-tree.html" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/default-configuration/target/site/apidocs/overview-tree.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/default-configuration/target/site/apidocs/package-list" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/default-configuration/target/site/apidocs/package-list" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/default-configuration/target/site/apidocs/stylesheet.css" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/default-configuration/target/site/apidocs/stylesheet.css" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
     }
 
@@ -140,14 +148,14 @@
     public void testSubpackages()
         throws Exception
     {
-        File testPom =
-            new File( getBasedir(), "src/test/resources/unit/subpackages-test/subpackages-test-plugin-config.xml" );
+        File testPom = new File( getBasedir(),
+                                 "src/test/resources/unit/subpackages-test/subpackages-test-plugin-config.xml" );
         JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
         mojo.execute();
 
         //check the excluded packages
-        File generatedFile =
-            new File( getBasedir(), "target/test/unit/subpackages-test/target/site/apidocs/subpackages/test/excluded" );
+        File generatedFile = new File( getBasedir(),
+                                       "target/test/unit/subpackages-test/target/site/apidocs/subpackages/test/excluded" );
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         generatedFile = new File( getBasedir(),
@@ -155,8 +163,8 @@
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         //check if the classes in the specified subpackages were included
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/subpackages-test/target/site/apidocs/subpackages/test/App.html" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/subpackages-test/target/site/apidocs/subpackages/test/App.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         generatedFile = new File( getBasedir(),
@@ -180,8 +188,7 @@
     public void testDocfiles()
         throws Exception
     {
-        File testPom =
-            new File( getBasedir(), "src/test/resources/unit/docfiles-test/docfiles-test-plugin-config.xml" );
+        File testPom = new File( getBasedir(), "src/test/resources/unit/docfiles-test/docfiles-test-plugin-config.xml" );
         JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
         mojo.execute();
 
@@ -197,12 +204,12 @@
                                   "target/test/unit/docfiles-test/target/site/apidocs/doc-files/included-dir2/sample-included2.gif" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/docfiles-test/target/site/apidocs/doc-files/excluded-dir1" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/docfiles-test/target/site/apidocs/doc-files/excluded-dir1" );
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/docfiles-test/target/site/apidocs/doc-files/excluded-dir2" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/docfiles-test/target/site/apidocs/doc-files/excluded-dir2" );
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
     }
 
@@ -221,8 +228,8 @@
         mojo.execute();
 
         //check if there is a tree page generated (notree == true)
-        File generatedFile =
-            new File( getBasedir(), "target/test/unit/custom-configuration/target/site/apidocs/overview-tree.html" );
+        File generatedFile = new File( getBasedir(),
+                                       "target/test/unit/custom-configuration/target/site/apidocs/overview-tree.html" );
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         generatedFile = new File( getBasedir(),
@@ -230,14 +237,14 @@
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         //check if the main index page was generated (noindex == true)
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/custom-configuration/target/site/apidocs/index-all.html" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/custom-configuration/target/site/apidocs/index-all.html" );
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         //check if the deprecated list and the deprecated api were generated (nodeprecated == true)
         //@todo Fix: the class-use of the deprecated api is still created eventhough the deprecated api of that class is no longer generated
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/custom-configuration/target/site/apidocs/deprecated-list.html" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/custom-configuration/target/site/apidocs/deprecated-list.html" );
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         generatedFile = new File( getBasedir(),
@@ -255,7 +262,8 @@
 
         //offlineLinks
         assertTrue( str.toLowerCase().indexOf(
-            "HREF=\"http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html\"".toLowerCase() ) != -1 );
+                                               "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 );
@@ -268,15 +276,15 @@
 
         //check the wildcard (*) package exclusions -- excludePackageNames parameter
         generatedFile = new File( getBasedir(),
-            "target/test/unit/custom-configuration/target/site/apidocs/custom/configuration/exclude1/Exclude1App.html" );
+                                  "target/test/unit/custom-configuration/target/site/apidocs/custom/configuration/exclude1/Exclude1App.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         generatedFile = new File( getBasedir(),
-            "target/test/unit/custom-configuration/target/site/apidocs/custom/configuration/exclude1/subexclude/SubexcludeApp.html" );
+                                  "target/test/unit/custom-configuration/target/site/apidocs/custom/configuration/exclude1/subexclude/SubexcludeApp.html" );
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         generatedFile = new File( getBasedir(),
-            "target/test/unit/custom-configuration/target/site/apidocs/custom/configuration/exclude2/Exclude2App.html" );
+                                  "target/test/unit/custom-configuration/target/site/apidocs/custom/configuration/exclude2/Exclude2App.html" );
         assertTrue( !FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
     }
 
@@ -293,8 +301,7 @@
         // doclet path contains the UmlGraph artifact
         // ----------------------------------------------------------------------
 
-        File testPom = new File( getBasedir(),
-                                 "src/test/resources/unit/doclet-test/doclet-test-plugin-config.xml" );
+        File testPom = new File( getBasedir(), "src/test/resources/unit/doclet-test/doclet-test-plugin-config.xml" );
         JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
         mojo.execute();
 
@@ -311,8 +318,7 @@
         // doclet path contains the twice UmlGraph artifacts
         // ----------------------------------------------------------------------
 
-        testPom = new File( getBasedir(),
-                                 "src/test/resources/unit/doclet-path-test/doclet-path-test-plugin-config.xml" );
+        testPom = new File( getBasedir(), "src/test/resources/unit/doclet-path-test/doclet-path-test-plugin-config.xml" );
         mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
         mojo.execute();
 
@@ -334,8 +340,8 @@
     public void testAggregate()
         throws Exception
     {
-        File testPom =
-            new File( getBasedir(), "src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml" );
+        File testPom = new File( getBasedir(),
+                                 "src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml" );
         JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
         mojo.execute();
 
@@ -383,8 +389,8 @@
     public void testQuotedPath()
         throws Exception
     {
-        File testPom =
-            new File( getBasedir(), "src/test/resources/unit/quotedpath'test/quotedpath-test-plugin-config.xml" );
+        File testPom = new File( getBasedir(),
+                                 "src/test/resources/unit/quotedpath'test/quotedpath-test-plugin-config.xml" );
         JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
         mojo.execute();
 
@@ -398,24 +404,20 @@
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
         //project level generated javadoc files
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/quotedpath'test/target/site/apidocs/index-all.html" );
+        generatedFile = new File( getBasedir(), "target/test/unit/quotedpath'test/target/site/apidocs/index-all.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/quotedpath'test/target/site/apidocs/index.html" );
+        generatedFile = new File( getBasedir(), "target/test/unit/quotedpath'test/target/site/apidocs/index.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/quotedpath'test/target/site/apidocs/overview-tree.html" );
+        generatedFile = new File( getBasedir(),
+                                  "target/test/unit/quotedpath'test/target/site/apidocs/overview-tree.html" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/quotedpath'test/target/site/apidocs/package-list" );
+        generatedFile = new File( getBasedir(), "target/test/unit/quotedpath'test/target/site/apidocs/package-list" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
 
-        generatedFile =
-            new File( getBasedir(), "target/test/unit/quotedpath'test/target/site/apidocs/stylesheet.css" );
+        generatedFile = new File( getBasedir(), "target/test/unit/quotedpath'test/target/site/apidocs/stylesheet.css" );
         assertTrue( FileUtils.fileExists( generatedFile.getAbsolutePath() ) );
     }
 
@@ -427,8 +429,8 @@
     {
         try
         {
-            File testPom =
-                new File( getBasedir(), "src/test/resources/unit/default-configuration/exception-test-plugin-config.xml" );
+            File testPom = new File( getBasedir(),
+                                     "src/test/resources/unit/default-configuration/exception-test-plugin-config.xml" );
             JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
             mojo.execute();
 
@@ -440,9 +442,9 @@
 
             try
             {
-                FileUtils.deleteDirectory( new File( getBasedir(), "exception") );
+                FileUtils.deleteDirectory( new File( getBasedir(), "exception" ) );
             }
-            catch( IOException ie )
+            catch ( IOException ie )
             {
                 // nop
             }
@@ -450,15 +452,6 @@
     }
 
     /**
-     * @see junit.framework.TestCase#tearDown()
-     */
-    protected void tearDown()
-        throws Exception
-    {
-        // nop
-    }
-
-    /**
      * Create test repository in target directory.
      * @throws IOException if any
      */
@@ -472,18 +465,23 @@
         File f = new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph/2.1" );
         f.mkdirs();
 
-        FileUtils.copyFile( new File( getBasedir(),
-                                      "src/test/resources/unit/doclet-test/artifact-doclet/umlgraph/UMLGraph/maven-metadata-local.xml" ),
-                            new File( getBasedir(),
-                                      "target/local-repo/umlgraph/UMLGraph/maven-metadata-local.xml" ) );
-
-        FileUtils.copyFile( new File( getBasedir(),
-                                      "src/test/resources/unit/doclet-test/artifact-doclet/umlgraph/UMLGraph/2.1/UMLGraph-2.1.jar" ),
-                            new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph/2.1/UMLGraph-2.1.jar" ) );
-
-        FileUtils.copyFile( new File( getBasedir(),
-                                      "src/test/resources/unit/doclet-test/artifact-doclet/umlgraph/UMLGraph/2.1/UMLGraph-2.1.pom" ),
-                            new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph/2.1/UMLGraph-2.1.pom" ) );
+        FileUtils
+            .copyFile(
+                       new File( getBasedir(),
+                                 "src/test/resources/unit/doclet-test/artifact-doclet/umlgraph/UMLGraph/maven-metadata-local.xml" ),
+                       new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph/maven-metadata-local.xml" ) );
+
+        FileUtils
+            .copyFile(
+                       new File( getBasedir(),
+                                 "src/test/resources/unit/doclet-test/artifact-doclet/umlgraph/UMLGraph/2.1/UMLGraph-2.1.jar" ),
+                       new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph/2.1/UMLGraph-2.1.jar" ) );
+
+        FileUtils
+            .copyFile(
+                       new File( getBasedir(),
+                                 "src/test/resources/unit/doclet-test/artifact-doclet/umlgraph/UMLGraph/2.1/UMLGraph-2.1.pom" ),
+                       new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph/2.1/UMLGraph-2.1.pom" ) );
 
         // ----------------------------------------------------------------------
         // UMLGraph-bis
@@ -492,18 +490,23 @@
         f = new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph-bis/2.1" );
         f.mkdirs();
 
-        FileUtils.copyFile( new File( getBasedir(),
-                                      "src/test/resources/unit/doclet-path-test/artifact-doclet/umlgraph/UMLGraph-bis/maven-metadata-local.xml" ),
-                            new File( getBasedir(),
-                                      "target/local-repo/umlgraph/UMLGraph-bis/maven-metadata-local.xml" ) );
-
-        FileUtils.copyFile( new File( getBasedir(),
-                                      "src/test/resources/unit/doclet-path-test/artifact-doclet/umlgraph/UMLGraph-bis/2.1/UMLGraph-bis-2.1.jar" ),
-                            new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph-bis/2.1/UMLGraph-bis-2.1.jar" ) );
-
-        FileUtils.copyFile( new File( getBasedir(),
-                                      "src/test/resources/unit/doclet-path-test/artifact-doclet/umlgraph/UMLGraph-bis/2.1/UMLGraph-bis-2.1.pom" ),
-                            new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph-bis/2.1/UMLGraph-bis-2.1.pom" ) );
+        FileUtils
+            .copyFile(
+                       new File( getBasedir(),
+                                 "src/test/resources/unit/doclet-path-test/artifact-doclet/umlgraph/UMLGraph-bis/maven-metadata-local.xml" ),
+                       new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph-bis/maven-metadata-local.xml" ) );
+
+        FileUtils
+            .copyFile(
+                       new File( getBasedir(),
+                                 "src/test/resources/unit/doclet-path-test/artifact-doclet/umlgraph/UMLGraph-bis/2.1/UMLGraph-bis-2.1.jar" ),
+                       new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph-bis/2.1/UMLGraph-bis-2.1.jar" ) );
+
+        FileUtils
+            .copyFile(
+                       new File( getBasedir(),
+                                 "src/test/resources/unit/doclet-path-test/artifact-doclet/umlgraph/UMLGraph-bis/2.1/UMLGraph-bis-2.1.pom" ),
+                       new File( getBasedir(), "target/local-repo/umlgraph/UMLGraph-bis/2.1/UMLGraph-bis-2.1.pom" ) );
 
         // ----------------------------------------------------------------------
         // commons-attributes-compiler
@@ -513,18 +516,23 @@
         f = new File( getBasedir(), "target/local-repo/org/tullmann/taglets/1.0" );
         f.mkdirs();
 
-        FileUtils.copyFile( new File( getBasedir(),
-                                      "src/test/resources/unit/taglet-test/artifact-taglet/org/tullmann/taglets/maven-metadata-local.xml" ),
-                            new File( getBasedir(),
-                                      "target/local-repo/org/tullmann/taglets/maven-metadata-local.xml" ) );
-
-        FileUtils.copyFile( new File( getBasedir(),
-                                      "src/test/resources/unit/taglet-test/artifact-taglet/org/tullmann/taglets/1.0/taglets-1.0.jar" ),
-                            new File( getBasedir(), "target/local-repo/org/tullmann/taglets/1.0/taglets-1.0.jar" ) );
-
-        FileUtils.copyFile( new File( getBasedir(),
-                                      "src/test/resources/unit/taglet-test/artifact-taglet/org/tullmann/taglets/1.0/taglets-1.0.pom" ),
-                            new File( getBasedir(), "target/local-repo/org/tullmann/taglets/1.0/taglets-1.0.pom" ) );
+        FileUtils
+            .copyFile(
+                       new File( getBasedir(),
+                                 "src/test/resources/unit/taglet-test/artifact-taglet/org/tullmann/taglets/maven-metadata-local.xml" ),
+                       new File( getBasedir(), "target/local-repo/org/tullmann/taglets/maven-metadata-local.xml" ) );
+
+        FileUtils
+            .copyFile(
+                       new File( getBasedir(),
+                                 "src/test/resources/unit/taglet-test/artifact-taglet/org/tullmann/taglets/1.0/taglets-1.0.jar" ),
+                       new File( getBasedir(), "target/local-repo/org/tullmann/taglets/1.0/taglets-1.0.jar" ) );
+
+        FileUtils
+            .copyFile(
+                       new File( getBasedir(),
+                                 "src/test/resources/unit/taglet-test/artifact-taglet/org/tullmann/taglets/1.0/taglets-1.0.pom" ),
+                       new File( getBasedir(), "target/local-repo/org/tullmann/taglets/1.0/taglets-1.0.pom" ) );
     }
 
     /**
@@ -561,8 +569,7 @@
         // taglet-test: check if a taglet is used
         // ----------------------------------------------------------------------
 
-        File testPom = new File( getBasedir(),
-                                 "src/test/resources/unit/taglet-test/taglet-test-plugin-config.xml" );
+        File testPom = new File( getBasedir(), "src/test/resources/unit/taglet-test/taglet-test-plugin-config.xml" );
         JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
         mojo.execute();
 
@@ -585,27 +592,48 @@
     {
         if ( !SystemUtils.isJavaVersionAtLeast( 1.5f ) )
         {
-            getContainer().getLogger().warn( "JdkDK 5.0 or more is required to run javadoc for " +
-                    "'org.apache.maven.plugin.javadoc.JavadocReportTest#testJdk5()'." );
+            getContainer().getLogger().warn(
+                                             "JdkDK 5.0 or more is required to run javadoc for "
+                                                 + "'org.apache.maven.plugin.javadoc.JavadocReportTest#testJdk5()'." );
             return;
         }
 
-        File testPom = new File( getBasedir(),
-                                 "src/test/resources/unit/jdk5-test/jdk5-test-plugin-config.xml" );
+        File testPom = new File( getBasedir(), "src/test/resources/unit/jdk5-test/jdk5-test-plugin-config.xml" );
         JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
         mojo.execute();
 
         File index = new File( getBasedir(), "target/test/unit/jdk5-test/target/site/apidocs/index.html" );
         assertTrue( FileUtils.fileExists( index.getAbsolutePath() ) );
 
-        File overviewSummary = new File( getBasedir(), "target/test/unit/jdk5-test/target/site/apidocs/overview-summary.html" );
+        File overviewSummary = new File( getBasedir(),
+                                         "target/test/unit/jdk5-test/target/site/apidocs/overview-summary.html" );
         assertTrue( FileUtils.fileExists( overviewSummary.getAbsolutePath() ) );
         String readed = readFile( overviewSummary );
         assertTrue( readed.indexOf( "<b>Test the package-info</b>" ) != -1 );
 
-        File packageSummary = new File( getBasedir(), "target/test/unit/jdk5-test/target/site/apidocs/jdk5/test/package-summary.html" );
+        File packageSummary = new File( getBasedir(),
+                                        "target/test/unit/jdk5-test/target/site/apidocs/jdk5/test/package-summary.html" );
         assertTrue( FileUtils.fileExists( packageSummary.getAbsolutePath() ) );
         readed = readFile( packageSummary );
         assertTrue( readed.indexOf( "<b>Test the package-info</b>" ) != -1 );
+    }
+
+    /**
+     * Test to find the javadoc executable when <code>java.home</code> is not in the JDK_HOME.
+     * In this case, try to use the <code>JAVA_HOME</code> environment variable.
+     *
+     * @throws Exception
+     */
+    public void testToFindJavadoc()
+        throws Exception
+    {
+        String oldJreHome = System.getProperty( "java.home" );
+        System.setProperty( "java.home", "foo/bar" );
+
+        File testPom = new File( getBasedir(), "src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml" );
+        JavadocReport mojo = (JavadocReport) lookupMojo( "javadoc", testPom );
+        mojo.execute();
+
+        System.setProperty( "java.home", oldJreHome );
     }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject1TestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject1TestMavenProjectStub.java?view=diff&rev=450405&r1=450404&r2=450405
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject1TestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject1TestMavenProjectStub.java Wed Sep 27 04:45:10 2006
@@ -16,13 +16,18 @@
  * limitations under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Scm;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
-
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
@@ -36,22 +41,6 @@
 
     public AggregateProject1TestMavenProjectStub()
     {
-        /*
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = null;
-
-        try
-        {
-            model = pomReader.read( new FileReader( new File( getBasedir() +
-                "/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml" ) ) );
-            setModel( model );
-        }
-        catch ( Exception e )
-        {
-
-        }
-
-*/
         setGroupId( "aggregate.test" );
         setArtifactId( "aggregate-test-project1" );
         setVersion( "1.0-SNAPSHOT" );
@@ -63,39 +52,57 @@
         artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
         setArtifact( artifact );
 
-        Scm scm = new Scm();
+        scm = new Scm();
         scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
-        setScm( scm );
 
-        Build build = new Build();
+        build = new Build();
         build.setFinalName( "aggregate-test-project1" );
         build.setDirectory( getBasedir() + "/target/test/unit/aggregate-test/target" );
-        setBuild( build );
 
         String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
         compileSourceRoots.add( basedir + "/src/test/resources/unit/aggregate-test/project1/aggregate/test/project1" );
         setCompileSourceRoots( compileSourceRoots );
-
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#getScm()
+     */
     public Scm getScm()
     {
         return scm;
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#setScm(org.apache.maven.model.Scm)
+     */
     public void setScm( Scm scm )
     {
         this.scm = scm;
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#getBuild()
+     */
     public Build getBuild()
     {
         return build;
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#setBuild(org.apache.maven.model.Build)
+     */
     public void setBuild( Build build )
     {
         this.build = build;
+    }
+
+    /**
+     * @see org.apache.maven.project.MavenProject#createArtifacts(org.apache.maven.artifact.factory.ArtifactFactory, java.lang.String, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
+     */
+    public Set createArtifacts( ArtifactFactory artifactFactory, String string, ArtifactFilter artifactFilter )
+        throws InvalidDependencyVersionException
+    {
+        return Collections.EMPTY_SET;
     }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject2TestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject2TestMavenProjectStub.java?view=diff&rev=450405&r1=450404&r2=450405
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject2TestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateProject2TestMavenProjectStub.java Wed Sep 27 04:45:10 2006
@@ -16,13 +16,18 @@
  * limitations under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.model.Build;
 import org.apache.maven.model.Scm;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
-
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
@@ -47,14 +52,12 @@
         artifact.setArtifactHandler( new DefaultArtifactHandlerStub() );
         setArtifact( artifact );
 
-        Scm scm = new Scm();
+        scm = new Scm();
         scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
-        setScm( scm );
 
-        Build build = new Build();
+        build = new Build();
         build.setFinalName( "aggregate-test-project2" );
         build.setDirectory( getBasedir() + "/target/test/unit/aggregate-test/target" );
-        setBuild( build );
 
         String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
@@ -62,23 +65,44 @@
         setCompileSourceRoots( compileSourceRoots );
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#getScm()
+     */
     public Scm getScm()
     {
         return scm;
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#setScm(org.apache.maven.model.Scm)
+     */
     public void setScm( Scm scm )
     {
         this.scm = scm;
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#getBuild()
+     */
     public Build getBuild()
     {
         return build;
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#setBuild(org.apache.maven.model.Build)
+     */
     public void setBuild( Build build )
     {
         this.build = build;
+    }
+
+    /**
+     * @see org.apache.maven.project.MavenProject#createArtifacts(org.apache.maven.artifact.factory.ArtifactFactory, java.lang.String, org.apache.maven.artifact.resolver.filter.ArtifactFilter)
+     */
+    public Set createArtifacts( ArtifactFactory artifactFactory, String string, ArtifactFilter artifactFilter )
+        throws InvalidDependencyVersionException
+    {
+        return Collections.EMPTY_SET;
     }
 }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.java?view=diff&rev=450405&r1=450404&r2=450405
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/java/org/apache/maven/plugin/javadoc/stubs/AggregateTestMavenProjectStub.java Wed Sep 27 04:45:10 2006
@@ -50,7 +50,7 @@
         }
         catch ( Exception e )
         {
-
+            throw new RuntimeException( e );
         }
 
         setGroupId( model.getGroupId() );
@@ -61,37 +61,46 @@
         setPackaging( model.getPackaging() );
         setExecutionRoot( true );
 
-        Scm scm = new Scm();
+        scm = new Scm();
         scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
-        setScm( scm );
 
-        Build build = new Build();
+        build = new Build();
         build.setFinalName( model.getArtifactId() );
         build.setDirectory( getBasedir() + "/target/test/unit/aggregate-test/target" );
-        setBuild( build );
 
         String basedir = getBasedir().getAbsolutePath();
         List compileSourceRoots = new ArrayList();
         compileSourceRoots.add( basedir + "/src/test/resources/unit/aggregate-test/aggregate/test" );
         setCompileSourceRoots( compileSourceRoots );
-
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#getScm()
+     */
     public Scm getScm()
     {
         return scm;
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#setScm(org.apache.maven.model.Scm)
+     */
     public void setScm( Scm scm )
     {
         this.scm = scm;
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#getBuild()
+     */
     public Build getBuild()
     {
         return build;
     }
 
+    /**
+     * @see org.apache.maven.project.MavenProject#setBuild(org.apache.maven.model.Build)
+     */
     public void setBuild( Build build )
     {
         this.build = build;

Added: maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/App.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/App.java?view=auto&rev=450405
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/App.java (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/App.java Wed Sep 27 04:45:10 2006
@@ -0,0 +1,17 @@
+package def.configuration;
+
+public class App
+{
+
+    public static void main( String[] args )
+    {
+        System.out.println( "Sample Application." );
+    }
+
+    
+    protected void sampleMethod( String str )
+    {
+        System.out.println( str );
+    }
+
+}
\ No newline at end of file

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

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

Added: maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/AppSample.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/AppSample.java?view=auto&rev=450405
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/AppSample.java (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/AppSample.java Wed Sep 27 04:45:10 2006
@@ -0,0 +1,20 @@
+package def.configuration;
+
+/**
+ * @author Maria Odea Ching
+ * @since 1.4
+ * @version %I%, %G%
+ */
+public class AppSample
+{
+
+    /**
+     * The main method
+     *
+     * @param args  an array of strings that contains the arguments
+     */
+    public static void main( String[] args )
+    {
+        System.out.println( "Another Sample Application" );
+    }
+}
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/AppSample.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/def/configuration/AppSample.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml?view=auto&rev=450405
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml (added)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml Wed Sep 27 04:45:10 2006
@@ -0,0 +1,55 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>javahome.test</groupId>
+  <artifactId>javahome-test</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <inceptionYear>2006</inceptionYear>
+  <name>Maven Javadoc Plugin Java home 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.DefaultConfigurationMavenProjectStub"/>
+          <localRepository>${localRepository}</localRepository>
+          <outputDirectory>${basedir}/target/test/unit/javaHome-test/target/site/apidocs</outputDirectory>
+          <breakiterator>false</breakiterator>
+          <old>false</old>
+          <show>protected</show>
+          <quiet>false</quiet>
+          <verbose>false</verbose>
+          <author>true</author>
+          <charset>ISO-8859-1</charset>
+          <docfilessubdirs>false</docfilessubdirs>
+          <linksource>false</linksource>
+          <nocomment>false</nocomment>
+          <nodeprecated>false</nodeprecated>
+          <nodeprecatedlist>false</nodeprecatedlist>
+          <nohelp>false</nohelp>
+          <noindex>false</noindex>
+          <nonavbar>false</nonavbar>
+          <nosince>false</nosince>
+          <notree>false</notree>
+          <serialwarn>false</serialwarn>
+          <splitindex>false</splitindex>
+          <stylesheet>java</stylesheet>
+          <groups>
+            <group/>
+          </groups>
+          <tags>
+            <tag/>
+          </tags>
+          <use>true</use>
+          <version>true</version>
+          <windowtitle>Maven Javadoc Plugin Java Home Test 1.0-SNAPSHOT API</windowtitle>
+          <links>
+             <param>http://java.sun.com/j2se/1.4.2/docs/api</param>
+          </links>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

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

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