code: @Nullable
      protected String getMavenFlattenPluginFlattenedPomFilename(@Nonnull MavenProject project) {
          for(Plugin buildPlugin : project.getBuildPlugins()) {
              if ("org.codehaus.mojo:flatten-maven-plugin".equals(buildPlugin.getKey())) {
                  String mavenConfigurationElement = "flattenedPomFilename";
                  for(PluginExecution execution: buildPlugin.getExecutions()) {
                      if (execution.getGoals().contains("flatten")) {
                          if (execution.getConfiguration() instanceof Xpp3Dom) {
                              Xpp3Dom configuration = (Xpp3Dom) execution.getConfiguration();
                              Xpp3Dom flattenedPomFilename = configuration.getChild(mavenConfigurationElement);
                              if (flattenedPomFilename != null) {
                                  return flattenedPomFilename.getValue();
                              }
                          } else {
                              // unexpected configuration type
                          }
                      }
                  }
                  if (buildPlugin.getConfiguration() instanceof Xpp3Dom) {
                      Xpp3Dom configuration = (Xpp3Dom) buildPlugin.getConfiguration();
                      Xpp3Dom flattenedPomFilename = configuration.getChild(mavenConfigurationElement);
                      if (flattenedPomFilename != null) {
                          return flattenedPomFilename.getValue();
                      }
                  } else {
                      // unexpected configuration type
                  }
              } else {
  
              }
          }
          return null;
      }
docs: If the Maven project uses the "flatten-maven-plugin" and defines the config parameter "flattenedPomFilename", get its value.
  
  TODO optimize and keep in cache this result
  
  @param project
  @return the "flattenedPomFilename" defined at the "flatten" execution level or at the plugin definition level. {@code null}