Maven Surefire
  1. Maven Surefire
  2. SUREFIRE-570

Empty surefire reports when a multi-module project is ran with multiple report directories in surefire-report configuration

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.3
    • Fix Version/s: 2.7.2
    • Labels:
      None
    • Environment:
      Tested on Windows XP & Linux (Ubuntu 09.04) with Maven 2.0.10
    • Complexity:
      Intermediate
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      With a multi-module project, if the reporting configuration set multiple report directories (in the parent POM), then the report / report-only goals generate empty report.

      The main / aggregated report says this is 0 Tests.
      Module reports are empty html files.

      The attached project is a sample project to reproduce this ...

      The parent POM reporting conf explicitely set 2 reporting directories.

      From the "parent" POM :

      • mvn surefire-report:report ==> normal report per modules, nothing to say
      • mvn clean
      • mvn surefire-report:report -Daggregate=true ==> parent report with 0 tests, empty html report for modules
      • mvn surefire-report:report; mvn surefire-report:report-only -Daggregate=true ==> idem, parent report with 0 tests, empty html report for modules
      1. SUREFIRE-570.diff
        3 kB
        Thomas Sauzedde
      2. surefire-report-test.tar.gz
        6 kB
        Thomas Sauzedde

        Issue Links

          Activity

          Hide
          Thomas Sauzedde added a comment -

          Did some investigations ...

          When "aggregate" is used, and reportDirectories are NOT configured explicilety, the plugin builds a reportDirectories array from each module in the reactor, and then the reports are generated.

          When reportDirectories are configured, the step above is skipped ...

          But if the configuration is inherited, and reportDirectories are set with something like $

          {basedir}

          , the basedir is resolved from the "parent" project POV, but not for each modules in the reactor ...

          I'm going to attach a patch to solve this by looking in each modules to see if there is a report directory around ...

          Show
          Thomas Sauzedde added a comment - Did some investigations ... When "aggregate" is used, and reportDirectories are NOT configured explicilety, the plugin builds a reportDirectories array from each module in the reactor, and then the reports are generated. When reportDirectories are configured, the step above is skipped ... But if the configuration is inherited, and reportDirectories are set with something like $ {basedir} , the basedir is resolved from the "parent" project POV, but not for each modules in the reactor ... I'm going to attach a patch to solve this by looking in each modules to see if there is a report directory around ...
          Hide
          Thomas Sauzedde added a comment -

          Patch to solve this issue.

          Patch done with the 2.4.3 tag as ancestor ...

          Show
          Thomas Sauzedde added a comment - Patch to solve this issue. Patch done with the 2.4.3 tag as ancestor ...
          Hide
          Kristian Rosenvold added a comment -

          Thanks for the patch! Applied with heavy modifications and integration test for both maven2 and maven3 in r1060976

          Show
          Kristian Rosenvold added a comment - Thanks for the patch! Applied with heavy modifications and integration test for both maven2 and maven3 in r1060976

            People

            • Assignee:
              Kristian Rosenvold
              Reporter:
              Thomas Sauzedde
            • Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: