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 2008/08/14 19:17:44 UTC
svn commit: r685965 -
/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/TestJavadocReport.java
Author: vsiveton
Date: Thu Aug 14 10:17:44 2008
New Revision: 685965
URL: http://svn.apache.org/viewvc?rev=685965&view=rev
Log:
MJAVADOC-202: Links ../apidocs from javadoc:javadoc to javadoc:test-javadoc
o be sure that ../apidocs is always added as report and as mojo
Modified:
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/TestJavadocReport.java
Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/TestJavadocReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/TestJavadocReport.java?rev=685965&r1=685964&r2=685965&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/TestJavadocReport.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/TestJavadocReport.java Thu Aug 14 10:17:44 2008
@@ -27,9 +27,8 @@
import java.util.ResourceBundle;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.reporting.MavenReportException;
import org.codehaus.plexus.util.StringUtils;
/**
@@ -142,22 +141,12 @@
// ----------------------------------------------------------------------
/** {@inheritDoc} */
- public void execute()
- throws MojoExecutionException, MojoFailureException
+ protected void executeReport( Locale unusedLocale )
+ throws MavenReportException
{
- if ( links == null )
- {
- links = new ArrayList();
- }
+ addMainJavadocLink();
- // TODO the prerequisite is that the main report is in apidocs
- File apidocs = new File( getReportOutputDirectory().getParentFile(), "apidocs" );
- if ( apidocs.exists() && apidocs.isDirectory() && !links.contains( "../apidocs" ) )
- {
- links.add( "../apidocs" );
- }
-
- super.execute();
+ super.executeReport( unusedLocale );
}
/** {@inheritDoc} */
@@ -305,4 +294,22 @@
{
return ResourceBundle.getBundle( "test-javadoc-report", locale, getClass().getClassLoader() );
}
+
+ /**
+ * Add the <code>../apidocs</code> to the links parameter so Test report could be linked to the Main report.
+ */
+ private void addMainJavadocLink()
+ {
+ if ( links == null )
+ {
+ links = new ArrayList();
+ }
+
+ // TODO the prerequisite is that the main report is in apidocs
+ File apidocs = new File( getReportOutputDirectory().getParentFile(), "apidocs" );
+ if ( apidocs.isDirectory() && !links.contains( "../apidocs" ) )
+ {
+ links.add( "../apidocs" );
+ }
+ }
}