code: public static void extractEligibleConfigurationForGoal(AbstractWisdomMojo mojo,
                                                             Plugin plugin, String goal, Xpp3Dom configuration) {
          try {
              MojoDescriptor descriptor = mojo.pluginManager.getMojoDescriptor(plugin, goal,
                      mojo.remoteRepos, mojo.repoSession);
              final List<Parameter> parameters = descriptor.getParameters();
              Xpp3Dom[] children = configuration.getChildren();
              if (children != null) {
                  for (int i = children.length - 1; i >= 0; i--) {
                      Xpp3Dom child = children[i];
                      if (!contains(parameters, child.getName())) {
                          configuration.removeChild(i);
                      }
                  }
              }
          } catch (Exception e) {
              mojo.getLog().warn("Cannot extract the eligible configuration for goal " + goal + " from the " +
                      "configuration");
              mojo.getLog().debug(e);
              // The configuration is not changed.
          }
  
      }
docs: Extracts the subset of the given configuration containing only the values accepted by the plugin/goal. The
  configuration is modified in-place. The the extraction fail the configuration stays unchanged.
  
  @param mojo          the Wisdom mojo
  @param plugin        the plugin object
  @param goal          the goal / mojo
  @param configuration the global configuration