boolean (Processor<? super MavenPluginDescriptor> processor, MavenDomConfiguration cfg) { Map<String, Map<String, Map<String, List<MavenPluginDescriptor>>>> map = getDescriptorsMap(); DomElement parent = cfg.getParent(); MavenDomPlugin plugin = DomUtil.getParentOfType(parent, MavenDomPlugin.class, false); if (plugin == null) return true; Map<String, Map<String, List<MavenPluginDescriptor>>> groupMap = map.get(plugin.getArtifactId().getStringValue()); if (groupMap == null) return true; Map<String, List<MavenPluginDescriptor>> goalsMap = groupMap.get(plugin.getGroupId().getStringValue()); if (goalsMap == null) return true; List<MavenPluginDescriptor> descriptorsForAllGoals = goalsMap.get(null); if (descriptorsForAllGoals != null) { for (MavenPluginDescriptor descriptor : descriptorsForAllGoals) { if (!processor.process(descriptor)) return false; } } if (parent instanceof MavenDomPluginExecution) { for (MavenDomGoal goal : ((MavenDomPluginExecution)parent).getGoals().getGoals()) { List<MavenPluginDescriptor> descriptors = goalsMap.get(goal.getStringValue()); if (descriptors != null) { for (MavenPluginDescriptor descriptor : descriptors) { if (!processor.process(descriptor)) return false; } } } } return true; }