code: static Map<MavenProject, List<MavenProject>> getProjects(List<MavenProject> reactorProjects,
                                                               String rulesDirectory, boolean useExecutionRootAsProjectRoot) throws MojoExecutionException {
          Map<MavenProject, List<MavenProject>> rootModules = new HashMap<>();
          for (MavenProject reactorProject : reactorProjects) {
              MavenProject rootModule =
                      ProjectResolver.getRootModule(reactorProject, reactorProjects, rulesDirectory, useExecutionRootAsProjectRoot);
              List<MavenProject> modules = rootModules.get(rootModule);
              if (modules == null) {
                  modules = new ArrayList<>();
                  rootModules.put(rootModule, modules);
              }
              modules.add(reactorProject);
          }
          return rootModules;
      }
docs: Aggregate projects to their base projects
  
  @param reactorProjects               The current reactor projects.
  @param rulesDirectory                The configured rules directory.
  @param useExecutionRootAsProjectRoot <code>true</code> if the execution root shall be used as project root.
  @return A map containing resolved base projects and their aggregated projects.
  @throws MojoExecutionException If aggregation fails.