public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles(String packaging) { if (logger.isDebugEnabled()) { logger.debug( "Looking up lifecyle mappings for packaging " + packaging + " from " + Thread.currentThread().getContextClassLoader()); } LifecycleMapping lifecycleMappingForPackaging = lifecycleMappings.get(packaging); if (lifecycleMappingForPackaging == null) { return null; } Map<Plugin, Plugin> plugins = new LinkedHashMap<>(); for (Lifecycle lifecycle : getOrderedLifecycles()) { org.apache.maven.lifecycle.mapping.Lifecycle lifecycleConfiguration = lifecycleMappingForPackaging.getLifecycles().get(lifecycle.getId()); Map<String, LifecyclePhase> phaseToGoalMapping = null; if (lifecycleConfiguration != null) { phaseToGoalMapping = lifecycleConfiguration.getPhases(); } else if (lifecycle.getDefaultPhases() != null) { phaseToGoalMapping = lifecycle.getDefaultPhases(); } if (phaseToGoalMapping != null) { for (Map.Entry<String, LifecyclePhase> goalsForLifecyclePhase : phaseToGoalMapping.entrySet()) { String phase = goalsForLifecyclePhase.getKey(); LifecyclePhase goals = goalsForLifecyclePhase.getValue(); if (goals != null) { parseLifecyclePhaseDefinitions(plugins, phase, goals); } } } } return plugins.keySet(); }