public static String getConfigValue()

in src/main/java/org/apache/sling/feature/maven/ProjectHelper.java [224:245]


    public static String getConfigValue(final Plugin plugin, final String name, final String defaultValue) {
        final Set<String> values = new HashSet<>();
        final Xpp3Dom config = plugin == null ? null : (Xpp3Dom) plugin.getConfiguration();
        final Xpp3Dom globalNode = (config == null ? null : config.getChild(name));
        if (globalNode != null) {
            values.add(globalNode.getValue());
        }
        for (final PluginExecution exec : plugin.getExecutions()) {
            final Xpp3Dom cfg = (Xpp3Dom) exec.getConfiguration();
            final Xpp3Dom pluginNode = (cfg == null ? null : cfg.getChild(name));
            if (pluginNode != null
                    && pluginNode.getValue() != null
                    && !pluginNode.getValue().isEmpty()) {
                values.add(pluginNode.getValue());
            }
        }
        if (values.size() > 1) {
            throw new RuntimeException("More than one value configured in plugin (executions) of " + plugin.getKey()
                    + " for " + name + " : " + values);
        }
        return values.isEmpty() ? defaultValue : values.iterator().next();
    }