Skip to content

Report aggregation executing before sub-modules #1

Description

@yeroc

Hi,

You've probably long-since moved on from this but just in case, do you have a working sample project? We tried using this plugin but discovered that in our multi-module setup the plugin ended up executing first because the top-level module executes first in the reactor. It looks like the current logic at Line 92 in src/main/java/org/codefilarete/maven/jacoco/ReportAggregateMojo.java:

  private boolean shouldDelayExecution() {                                                                                                                                                                                                                      
      return !session.getCurrentProject().isExecutionRoot();                                                                                                                                                                                                    
  }                                                                                                                                                                                                                                                             

Should be changed to something like:

  private boolean shouldDelayExecution() {                                                                                                                                                                                                                      
      List<MavenProject> projects = session.getProjects();                                                                                                                                                                                                      
      return session.getCurrentProject() != projects.get(projects.size() - 1);                                                                                                                                                                                  
  }

to ensure the aggregation executes with the last module in the build but I'm probably missing something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions