code: static MavenProject getRootModule(MavenProject module, List<MavenProject> reactor, String rulesDirectory, boolean useExecutionRootAsProjectRoot)
              throws MojoExecutionException {
          String rootModuleContextKey = ProjectResolver.class.getName() + "#rootModule";
          MavenProject rootModule = (MavenProject) module.getContextValue(rootModuleContextKey);
          if (rootModule == null) {
              if (useExecutionRootAsProjectRoot) {
                  rootModule = getRootModule(reactor);
              } else {
                  rootModule = getRootModule(module, rulesDirectory);
              }
              module.setContextValue(rootModuleContextKey, rootModule);
          }
          return rootModule;
      }
docs: Return the {@link MavenProject} which is the base module for scanning
  and analysis.
  
  The base module is by searching with the module tree starting from the current module over its parents until a module is found containing a
  directory "jqassistant" or no parent can be determined.
  
  @param module                        The current module.
  @param rulesDirectory                The name of the directory used for identifying the root module.
  @param useExecutionRootAsProjectRoot `true` if the execution root shall be used as project root.
  @return The {@link MavenProject} containing a rules directory.
  @throws MojoExecutionException If the directory cannot be resolved.