Issue Details (XML | Word | Printable)

Key: MJAVADOC-212
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Vincent Siveton
Reporter: Vincent Siveton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Javadoc Plugin

AggregatorJavadocReport/AggregatorTestJavadocReport are used by default in aggregator and no reports are generated

Created: 12/Aug/08 06:03 AM   Updated: 13/Aug/08 05:02 PM   Resolved: 13/Aug/08 05:02 PM
Return to search
Component/s: None
Affects Version/s: 2.5
Fix Version/s: 2.5

Time Tracking:
Not Specified

File Attachments: 1. Text File javadoc-aggregation.patch (6 kB)
2. Text File MJAVADOC-212.patch (2 kB)

Issue Links:
Related
 


 Description  « Hide

In multimodule way, AggregatorJavadocReport/AggregatorTestJavadocReport are used by default. Due to the following in the code,

AbstractJavadocMojo.java
if ( aggregate && !project.isExecutionRoot() )
        {
            return;
        }

the report is skipped.



Vincent Siveton made changes - 12/Aug/08 06:03 AM
Field Original Value New Value
Fix Version/s 2.5 [ 14120 ]
Vincent Siveton made changes - 12/Aug/08 06:03 AM
Link This issue is related to MJAVADOC-196 [ MJAVADOC-196 ]
Vincent Siveton added a comment - 12/Aug/08 06:15 AM

To reproduce it, go to plugin-tools or plugin-testing and run:

plugin-tools>mvn clean site:stage -DstagingDirectory=C:\target -X -Ddebug -Preporting 

You will see an empty maven-plugin-tools-api\apidocs\index.html or maven-plugin-tools-api\testapidocs\index.html


Vincent Siveton added a comment - 12/Aug/08 06:24 AM

In fact, I noticed some warn like the following:

[INFO] Skipped "JavaDocs" report, file "apidocs/index.html" already exists for the English version.

So, AggregatorJavadocReport and JavadocReport are both used. It is normal IMHO since the PluginManager invokes all MavenReport.


Vincent Siveton added a comment - 12/Aug/08 06:44 AM

A solution could be to move the aggregate parameter into AggregatorJavadocReport/AggregatorTestJavadocReport or to create a new parameter, like aggregator, only for these mojos.


Vincent Siveton added a comment - 12/Aug/08 12:57 PM

Proposed patch.
By default, AggregatorJavadocReport/AggregatorTestJavadocReport will never be called at least aggregator parameter is specified.


Vincent Siveton made changes - 12/Aug/08 12:57 PM
Attachment MJAVADOC-212.patch [ 36465 ]
Benjamin Bentmann added a comment - 12/Aug/08 01:41 PM - edited

Another idea: Currently, the parameter "aggregate" controls the aggregation behavior of say "javadoc:javadoc". However, this is not reliable, proper aggregation also requires to collectively fork all projects in the reactor. This can only be achieved via the "@aggregator" mojo annotation. So I believe the natural solution is to query the existence of this annotation whereever the code now checks the "aggregate" parameter. Hence, I added a new method isAggregator() that mojos override to report their aggregating behavior.

The existing parameter "aggregate" is kept only for convenience during the site lifecycle. The implementation of canGenerateReport() will skip those reports whose aggregator flag doesn't match the value specified by the user via "aggregate". This should allow to run either JavadocReport or AggregateJavadocReport without the need for <reportSets>. The parameter is ignored when the mojos are invoked via cli or build lifecycle, i.e. "mvn javadoc:javadoc -Daggregate=true" will no longer produce aggregated output. Instead, users should call "mvn javadoc:aggregate". That's a break, but I believe that's the only correct way in terms of proper aggregation.

I haven't tested this yet, it's merely a sketch for discussion.


Benjamin Bentmann made changes - 12/Aug/08 01:41 PM
Attachment javadoc-aggregation.patch [ 36468 ]
Benjamin Bentmann added a comment - 12/Aug/08 01:51 PM

Considering the penalty of the forked lifecycles during the site generation of every module caused by "@aggregator" on the new mojos, I would however assume that people will sooner than later user <reportSets> to disable them from running in child modules.


Vincent Siveton added a comment - 13/Aug/08 05:02 PM

Patch applied in r685691 and r685692, snapshot deployed.
Thanks!


Vincent Siveton made changes - 13/Aug/08 05:02 PM
Assignee Vincent Siveton [ siveton ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]