Maven 2 & 3

Execution order of report plugins is arbitrary if inheritance is involved

Details

  • Complexity:
    Intermediate
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

I have created a maven 2 report : Dashboard report which aggregate all reports results in one report.

My plugin must be executed as the last one even if i can't bind the "post-site" phase or use the "aggregator" annotation.

I declare my report plugin as the last one in the reporting section of my POM.

When i run mvn site on a single project, it's ok, my plugin has been executed as the last one.

The reports list has been ordered as declared in my POM.

But if i run "mvn site" on a multi-project POM, the reports list isn't ordered as before.

I think, it's the same problem as http://jira.codehaus.org/browse/MNG-1994?page=all

Issue Links

Activity

Hide
Benoit Xhenseval added a comment -

We have exactly the same problem here....
Where does Maven determine the order for reports?

Show
Benoit Xhenseval added a comment - We have exactly the same problem here.... Where does Maven determine the order for reports?
Hide
John Allen added a comment -

Execution order of plugin's is something that has had quite a bit of discussion about but I'm afraid I have no specific URLs to let you catch up with the current thinking re this.

Show
John Allen added a comment - Execution order of plugin's is something that has had quite a bit of discussion about but I'm afraid I have no specific URLs to let you catch up with the current thinking re this.
Hide
Danilo Eiji Seki added a comment -

I noticed something strange and made a test. I suspected plugins/reports were being executed in alphabetic order (first by groupId, then by artifactId) and so they are!

For example, I have a problem generating QALab reports in child projects, because QALab plugin was always executed before the reports that generate data. Then I noticed the reports were generated almost in the order I specify them (I use the above alphabetic order, expept for the QALab plugin, that is the last one). Then I imagined that maybe that happens because all my reports are from org. groups while QALab belongs to net..

I tested it by creating a dummy plugin by renaming the groupId of a QALab report plugin to zzz.net.objectlab and deploying it to my local repository. Then I changed my root dependency to this new one and magic, IT WORKS.

I suspect someone is using a sorted collection (tree set, etc). Some display-beautifuly-list is messing things up.

Show
Danilo Eiji Seki added a comment - I noticed something strange and made a test. I suspected plugins/reports were being executed in alphabetic order (first by groupId, then by artifactId) and so they are! For example, I have a problem generating QALab reports in child projects, because QALab plugin was always executed before the reports that generate data. Then I noticed the reports were generated almost in the order I specify them (I use the above alphabetic order, expept for the QALab plugin, that is the last one). Then I imagined that maybe that happens because all my reports are from org. groups while QALab belongs to net.. I tested it by creating a dummy plugin by renaming the groupId of a QALab report plugin to zzz.net.objectlab and deploying it to my local repository. Then I changed my root dependency to this new one and magic, IT WORKS. I suspect someone is using a sorted collection (tree set, etc). Some display-beautifuly-list is messing things up.
Hide
Carlos Sanchez added a comment -

Patch against 2.1.x with unit test

mergeReportPluginLists behavior copied from mergePluginLists which was fixed in related issues

Show
Carlos Sanchez added a comment - Patch against 2.1.x with unit test mergeReportPluginLists behavior copied from mergePluginLists which was fixed in related issues
Hide
Carlos Sanchez added a comment -

also for some reason, as commented in the unit test, the configurations of reports don't seem to be merged

Show
Carlos Sanchez added a comment - also for some reason, as commented in the unit test, the configurations of reports don't seem to be merged
Hide
Brett Porter added a comment -

applied

Show
Brett Porter added a comment - applied
Hide
Luca added a comment -

using 2.1 the order is still not respected, I define in the parent a couple of report plugins and when the site phase is executed on the child, the order is not respected

Show
Luca added a comment - using 2.1 the order is still not respected, I define in the parent a couple of report plugins and when the site phase is executed on the child, the order is not respected
Hide
Paul Benedict added a comment -

Carlos, was this patch properly applied to 2.1?

Show
Paul Benedict added a comment - Carlos, was this patch properly applied to 2.1?
Hide
Brett Porter added a comment -

I applied it, and created an IT. Please compare your use case to the IT, and file a new issue against 2.1.0 with a sample project if there is a problem.

Show
Brett Porter added a comment - I applied it, and created an IT. Please compare your use case to the IT, and file a new issue against 2.1.0 with a sample project if there is a problem.

People

Vote (32)
Watch (22)

Dates

  • Created:
    Updated:
    Resolved: