code: static List collectActiveProfiles(final MavenProject project) {
      final List profiles = project.getActiveProfiles();
  
      if (project.hasParent()) {
        profiles.addAll(collectActiveProfiles(project.getParent()));
      }
  
      return profiles;
    }
docs: (Darren) this code lifted from mvn help:active-profiles plugin Recurses
  into the project's parent poms to find the active profiles of the
  specified project and all its parents.
  
  @param project
  The project to start with
  @return A list of active profiles