Maven 2.x Javadoc Plugin

Javadoc plugin ignores destDir when used in reporting section

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.0
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    1

Description

When used in the reporting section of the pom and 'mvn site', output always goes to target/apidocs, even if you specify an outputDir.

Having outputDir work correctly would by useful with alternate doclets, for example sending the output of the UMLGraph doclet to target/uml so that it can be further transformed.

This seems to be the code that's doing it:
if ( !javadocDirectory.getAbsolutePath().equals( getOutputDirectory() ) )

{ // we're in site-embedded report mode, so Doxia has set the // reportOutputDirectory to the basedir of the site. // Append 'apidocs'. javadocDirectory = new File( javadocDirectory, "apidocs" ); }

Activity

Hide
Wendy Smoak added a comment -

Sorry. No idea where I got 'outputDir'. The title is correct, I'm specifying 'destDir' :
<configuration>
...
<destDir>target/uml</destDir>
</configuration>
and it is ignored when used within the <reporting> section. It works fine in the normal <build><plugins><plugin>... section.

There is a complete example of my configuration in the patch for MJAVADOC-46.

Show
Wendy Smoak added a comment - Sorry. No idea where I got 'outputDir'. The title is correct, I'm specifying 'destDir' : <configuration> ... <destDir>target/uml</destDir> </configuration> and it is ignored when used within the <reporting> section. It works fine in the normal <build><plugins><plugin>... section. There is a complete example of my configuration in the patch for MJAVADOC-46.
Hide
Maria Odea Ching added a comment -

Attached patch file that fixes this issue.

Changed:

File javadocDirectory = getReportOutputDirectory();
if ( !javadocDirectory.getAbsolutePath().equals( getOutputDirectory() ) )
{
// we're in site-embedded report mode, so Doxia has set the
// reportOutputDirectory to the basedir of the site.
// Append 'apidocs'.
javadocDirectory = new File( javadocDirectory, "apidocs" );
}

to
File javadocDirectory = new File( getOutputDirectory() );

Show
Maria Odea Ching added a comment - Attached patch file that fixes this issue. Changed: File javadocDirectory = getReportOutputDirectory(); if ( !javadocDirectory.getAbsolutePath().equals( getOutputDirectory() ) ) { // we're in site-embedded report mode, so Doxia has set the // reportOutputDirectory to the basedir of the site. // Append 'apidocs'. javadocDirectory = new File( javadocDirectory, "apidocs" ); } to File javadocDirectory = new File( getOutputDirectory() );
Hide
Allan Ramirez added a comment -

Applied Patch. Thanks

Show
Allan Ramirez added a comment - Applied Patch. Thanks

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
Not Specified
Original Estimate - Not Specified
Remaining:
0m
Remaining Estimate - 0 minutes
Logged:
3h 30m
Time Spent - 3 hours, 30 minutes