Repository: maven Updated Branches: refs/heads/master d5ba185c1 -> 901b1e8e4
[MNG-5359] Declared execution in PluginMgmt gets bound to lifecycle (regression) o Updated 'LifeCyclePluginAnalyzer' to use a lesser confusing method name. o Moved logic from 'DefaultLifecycleBindingsInjector' to 'DefaultLifecyclePluginAnalyzer'. o Added various TODOs to 'DefaultLifecyclePluginAnalyzer'. o Is anyone reading this? Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/901b1e8e Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/901b1e8e Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/901b1e8e Branch: refs/heads/master Commit: 901b1e8e4c9df50ccc12bf8759589c7c82400aae Parents: d5ba185 Author: Christian Schulte <[email protected]> Authored: Tue Dec 22 07:32:41 2015 +0100 Committer: Christian Schulte <[email protected]> Committed: Tue Dec 22 07:32:41 2015 +0100 ---------------------------------------------------------------------- .../project/EmptyLifecyclePluginAnalyzer.java | 4 +- .../lifecycle/LifeCyclePluginAnalyzer.java | 14 +- .../DefaultLifecycleMappingDelegate.java | 7 +- .../DefaultLifecyclePluginAnalyzer.java | 208 ++++++++++++------- .../DefaultLifecycleBindingsInjector.java | 45 +--- .../lifecycle/EmptyLifecyclePluginAnalyzer.java | 5 +- .../stub/LifeCyclePluginAnalyzerStub.java | 12 +- 7 files changed, 161 insertions(+), 134 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven/blob/901b1e8e/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java ---------------------------------------------------------------------- diff --git a/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java b/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java index 925e346..ead0157 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java +++ b/maven-compat/src/test/java/org/apache/maven/project/EmptyLifecyclePluginAnalyzer.java @@ -24,6 +24,7 @@ import java.util.LinkedHashSet; import java.util.Set; import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer; +import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; import org.apache.maven.model.PluginExecution; @@ -33,6 +34,7 @@ import org.apache.maven.model.PluginExecution; public class EmptyLifecyclePluginAnalyzer implements LifeCyclePluginAnalyzer { + public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ) { Set<Plugin> plugins; @@ -58,7 +60,7 @@ public class EmptyLifecyclePluginAnalyzer } @Override - public Set<Plugin> getPlugins( final String packaging, final Set<String> phases ) + public Set<Plugin> getDefaultBuildPlugins( final Model model, final Set<String> goals ) { return Collections.emptySet(); } http://git-wip-us.apache.org/repos/asf/maven/blob/901b1e8e/maven-core/src/main/java/org/apache/maven/lifecycle/LifeCyclePluginAnalyzer.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/LifeCyclePluginAnalyzer.java b/maven-core/src/main/java/org/apache/maven/lifecycle/LifeCyclePluginAnalyzer.java index ef17560..536e167 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/LifeCyclePluginAnalyzer.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/LifeCyclePluginAnalyzer.java @@ -20,6 +20,8 @@ package org.apache.maven.lifecycle; */ import java.util.Set; + +import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; /** @@ -34,17 +36,17 @@ public interface LifeCyclePluginAnalyzer throws LifecycleMappingNotFoundException; /** - * Gets the lifecycle {@code Plugin}s for a given packaging and set of phases. + * Gets a set of default build {@code Plugin}s for a given {@code Model} and a Maven execution with the given goals. * - * @param packaging The packaging to get plugins for. - * @param phases The phases to get plugins for. + * @param model The model to get the default build {@code Plugin}s for. + * @param goals A set of goals of the current Maven invokation. * - * @return All lifecycle {@code Plugin}s for the given {@code packaging} and {@code phases}. + * @return A set of default build {@code Plugin}s for {@code Model}. * - * @throws LifecycleMappingNotFoundException if {@code packaging} does not identify a supported packaging. + * @throws LifecycleMappingNotFoundException if {@code model} does not declare a supported packaging. * @since 3.4 */ - Set<Plugin> getPlugins( String packaging, Set<String> phases ) + Set<Plugin> getDefaultBuildPlugins( Model model, Set<String> goals ) throws LifecycleMappingNotFoundException; } http://git-wip-us.apache.org/repos/asf/maven/blob/901b1e8e/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java index 46b9a9a..305fa4e 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleMappingDelegate.java @@ -21,7 +21,6 @@ package org.apache.maven.lifecycle.internal; import java.util.ArrayList; import java.util.Collections; -import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -57,10 +56,8 @@ public class DefaultLifecycleMappingDelegate @Override public Set<String> getRequiredLifecycles() { - // The default delegate requires the default lifecycle to operate. - final Set<String> requiredLifecycles = new HashSet<>(); - requiredLifecycles.add( "default" ); - return Collections.unmodifiableSet( requiredLifecycles ); + // The default delegate requires no lifecycles to operate. + return Collections.emptySet(); } public Map<String, List<MojoExecution>> calculateLifecycleMappings( MavenSession session, MavenProject project, http://git-wip-us.apache.org/repos/asf/maven/blob/901b1e8e/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java index 585eb6e..b98b5f1 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java @@ -21,7 +21,6 @@ package org.apache.maven.lifecycle.internal; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; @@ -38,6 +37,7 @@ import org.apache.maven.lifecycle.LifecycleMappingNotFoundException; import org.apache.maven.lifecycle.mapping.LifecycleMapping; import org.apache.maven.lifecycle.mapping.LifecycleMojo; import org.apache.maven.lifecycle.mapping.LifecyclePhase; +import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; import org.apache.maven.model.PluginExecution; import org.codehaus.plexus.component.annotations.Component; @@ -51,8 +51,8 @@ import org.codehaus.plexus.util.StringUtils; * @author Jason van Zyl * @author jdcasey * @author Kristian Rosenvold (extracted class only) - * <p/> - * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. + * <p/> + * NOTE: This class is not part of any public api and can be changed or deleted without prior notice. */ @Component( role = LifeCyclePluginAnalyzer.class ) public class DefaultLifecyclePluginAnalyzer @@ -82,19 +82,16 @@ public class DefaultLifecyclePluginAnalyzer // <plugin/> block in a Maven POM. We have to do some wiggling to pull the sources of information // together and this really shows the problem of constructing a sensible default configuration but // it's all encapsulated here so it appears normalized to the POM builder. - // We are going to take the project packaging and find all plugin in the default lifecycle and create // fully populated Plugin objects, including executions with goals and default configuration taken // from the plugin.xml inside a plugin. - // - public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ) throws LifecycleMappingNotFoundException { if ( logger.isDebugEnabled() ) { logger.debug( "Looking up lifecyle mappings for packaging " + packaging + " from " - + Thread.currentThread().getContextClassLoader() ); + + Thread.currentThread().getContextClassLoader() ); } LifecycleMapping lifecycleMappingForPackaging = lifecycleMappings.get( packaging ); @@ -140,110 +137,175 @@ public class DefaultLifecyclePluginAnalyzer } @Override - public Set<Plugin> getPlugins( final String packaging, final Set<String> phases ) + public Set<Plugin> getDefaultBuildPlugins( final Model model, final Set<String> goals ) throws LifecycleMappingNotFoundException { - if ( logger.isDebugEnabled() ) - { - logger.debug( "Looking up lifecyle mappings for packaging " + packaging + " from " - + Thread.currentThread().getContextClassLoader() ); - } - - final LifecycleMapping lifecycleMappingForPackaging = this.lifecycleMappings.get( packaging ); + final Map<Plugin, Plugin> defaultBuildPlugins = new LinkedHashMap<>(); + final Set<String> executedLifecycles = new HashSet<>(); - if ( lifecycleMappingForPackaging == null ) + // Plugins of lifecycles of the 'MavenExecutionRequest' goals or the project default goals. + if ( goals != null ) { - throw new LifecycleMappingNotFoundException( packaging ); - } + if ( !goals.isEmpty() ) + { + // Command line goals. + for ( final String goal : goals ) + { + if ( !isGoalSpecification( goal ) ) + { + final Lifecycle lifecycle = this.defaultLifeCycles.get( goal ); - final Map<Plugin, Plugin> plugins = new LinkedHashMap<>(); - final Set<String> requiredLifecycles = new HashSet<>(); + if ( lifecycle != null ) + { + executedLifecycles.add( lifecycle.getId() ); + } + } + } + } + else if ( model.getBuild() != null && model.getBuild().getDefaultGoal() != null ) + { + // No command line goals -> default goal(s). + // Copied from 'DefaultLifecycleTaskSegmentCalculator'. + if ( !StringUtils.isEmpty( model.getBuild().getDefaultGoal() ) ) + { + for ( final String goal + : Arrays.asList( StringUtils.split( model.getBuild().getDefaultGoal() ) ) ) + { + if ( !isGoalSpecification( goal ) ) + { + final Lifecycle lifecycle = this.defaultLifeCycles.get( goal ); - for ( final Lifecycle lifecycle : this.defaultLifeCycles.getLifeCycles() ) - { - // Keep in sync with - // DefaultLifecycleExecutionPlanCalculator#calculateLifecycleMappings( MavenSession session, - // MavenProject project, - // String lifecyclePhase ) - final LifecycleMappingDelegate lifecycleMappingDelegate = - Arrays.binarySearch( DefaultLifecycles.STANDARD_LIFECYCLES, lifecycle.getId() ) >= 0 - ? defaultLifecycleMappingDelegate - : lifecycleMappingDelegates.containsKey( lifecycle.getId() ) - ? lifecycleMappingDelegates.get( lifecycle.getId() ) - : defaultLifecycleMappingDelegate; - - requiredLifecycles.addAll( lifecycleMappingDelegate.getRequiredLifecycles() ); + if ( lifecycle != null ) + { + executedLifecycles.add( lifecycle.getId() ); + } + } + } + } + } } - for ( final Lifecycle lifecycle : this.getOrderedLifecycles() ) + // If nothing is to be executed via MavenExecutionRequest or default goals from the model, no need to provide + // anything as nothing will ever get executed. + if ( !executedLifecycles.isEmpty() ) { - org.apache.maven.lifecycle.mapping.Lifecycle lifecycleConfiguration = - lifecycleMappingForPackaging.getLifecycles().get( lifecycle.getId() ); - - Map<String, LifecyclePhase> phaseToGoalMapping = null; - - if ( lifecycleConfiguration != null ) + // Plugins of lifecycles plugin executions are bound to manually. + if ( model.getBuild() != null && model.getBuild().getPlugins() != null ) { - phaseToGoalMapping = lifecycleConfiguration.getLifecyclePhases(); - } - else if ( lifecycle.getDefaultLifecyclePhases() != null ) - { - phaseToGoalMapping = lifecycle.getDefaultLifecyclePhases(); + for ( final Plugin plugin : model.getBuild().getPlugins() ) + { + executedLifecycles.addAll( this.getLifecycleRequirements( plugin ) ); + } } - if ( phaseToGoalMapping != null ) + // Plugins of lifecycles required by lifecycle mapping delegates. + for ( final Lifecycle lifecycle : this.defaultLifeCycles.getLifeCycles() ) { - final Collection<String> lifecyclePhases = new ArrayList<>(); - - if ( lifecycleConfiguration != null && lifecycle.getPhases() != null ) + // Keep in sync with + // DefaultLifecycleExecutionPlanCalculator#calculateLifecycleMappings( MavenSession session, + // MavenProject project, + // String lifecyclePhase ) + final LifecycleMappingDelegate lifecycleMappingDelegate = + Arrays.binarySearch( DefaultLifecycles.STANDARD_LIFECYCLES, lifecycle.getId() ) >= 0 + ? defaultLifecycleMappingDelegate + : lifecycleMappingDelegates.containsKey( lifecycle.getId() ) + ? lifecycleMappingDelegates.get( lifecycle.getId() ) + : defaultLifecycleMappingDelegate; + + for ( final String id : lifecycleMappingDelegate.getRequiredLifecycles() ) { - lifecyclePhases.addAll( lifecycle.getPhases() ); - } - else if ( lifecycle.getDefaultLifecyclePhases() != null ) - { - lifecyclePhases.addAll( lifecycle.getDefaultLifecyclePhases().keySet() ); + executedLifecycles.add( id ); } + } + } - lifecyclePhases.retainAll( phases ); + for ( final Lifecycle lifecycle : this.getOrderedLifecycles() ) + { + if ( executedLifecycles.contains( lifecycle.getId() ) ) + { + org.apache.maven.lifecycle.mapping.Lifecycle lifecycleConfiguration = null; - if ( this.logger.isDebugEnabled() ) + if ( lifecycle.getId().equals( "default" ) ) { - if ( requiredLifecycles.contains( lifecycle.getId() ) ) + if ( logger.isDebugEnabled() ) { - this.logger.debug( String.format( - "Injecting build plugins of lifecyle '%s' required by a lifecycle mapping delegate.", - lifecycle.getId() ) ); + logger.debug( String.format( "Looking up lifecyle mappings for packaging '%s' from '%s'", + model.getPackaging(), + Thread.currentThread().getContextClassLoader() ) ); } - else if ( !lifecyclePhases.isEmpty() ) - { - this.logger.debug( String.format( - "Injecting build plugins of lifecyle '%s' required by a lifecycle phase.", - lifecycle.getId() ) ); + final LifecycleMapping lifecycleMappingForPackaging = + this.lifecycleMappings.get( model.getPackaging() ); + + if ( lifecycleMappingForPackaging == null ) + { + throw new LifecycleMappingNotFoundException( model.getPackaging() ); } + + lifecycleConfiguration = lifecycleMappingForPackaging.getLifecycles().get( lifecycle.getId() ); } - // Adds the plugins from the lifecycle if required by a 'LifecycleMappingDelegate' or by a phase getting - // executed. - if ( requiredLifecycles.contains( lifecycle.getId() ) || !lifecyclePhases.isEmpty() ) + Map<String, LifecyclePhase> phaseToGoalMapping = null; + + if ( lifecycleConfiguration != null ) + { + phaseToGoalMapping = lifecycleConfiguration.getLifecyclePhases(); + } + else if ( lifecycle.getDefaultLifecyclePhases() != null ) + { + phaseToGoalMapping = lifecycle.getDefaultLifecyclePhases(); + } + + if ( phaseToGoalMapping != null ) { for ( final Map.Entry<String, LifecyclePhase> goalsForLifecyclePhase : phaseToGoalMapping.entrySet() ) { final String phase = goalsForLifecyclePhase.getKey(); - final LifecyclePhase goals = goalsForLifecyclePhase.getValue(); + final LifecyclePhase lifecyclePhase = goalsForLifecyclePhase.getValue(); if ( goals != null ) { - parseLifecyclePhaseDefinitions( plugins, phase, goals ); + parseLifecyclePhaseDefinitions( defaultBuildPlugins, phase, lifecyclePhase ); } } } } } - return plugins.keySet(); + return defaultBuildPlugins.keySet(); + } + + private Set<String> getLifecycleRequirements( final Plugin plugin ) + { + final Set<String> executedLifecycles = new HashSet<>(); + + for ( final PluginExecution pluginExecution : plugin.getExecutions() ) + { + if ( pluginExecution.getPhase() != null ) + { + final Lifecycle lifecycle = this.defaultLifeCycles.get( pluginExecution.getPhase() ); + + if ( lifecycle != null ) + { + executedLifecycles.add( lifecycle.getId() ); + } + } + else + { + // TODO: If omitted, the goals will be bound to the default phase specified by the plugin. + // TODO: Forked executions. + } + } + + return executedLifecycles; + } + + // Copied from 'DefaultLifecycleTaskSegmentCalculator'. + private static boolean isGoalSpecification( String task ) + { + return task.indexOf( ':' ) >= 0; } private List<Lifecycle> getOrderedLifecycles() @@ -280,7 +342,7 @@ public class DefaultLifecyclePluginAnalyzer if ( gs == null ) { logger.warn( "Ignored invalid goal specification '" + mojo.getGoal() - + "' from lifecycle mapping for phase " + phase ); + + "' from lifecycle mapping for phase " + phase ); continue; } http://git-wip-us.apache.org/repos/asf/maven/blob/901b1e8e/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java ---------------------------------------------------------------------- diff --git a/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java b/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java index 69190fb..b77bf0a 100644 --- a/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java +++ b/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java @@ -20,14 +20,12 @@ package org.apache.maven.model.plugin; */ import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.Set; import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer; import org.apache.maven.lifecycle.LifecycleMappingNotFoundException; @@ -43,9 +41,9 @@ import org.apache.maven.model.building.ModelProblem.Version; import org.apache.maven.model.building.ModelProblemCollector; import org.apache.maven.model.building.ModelProblemCollectorRequest; import org.apache.maven.model.merge.MavenModelMerger; + import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import org.codehaus.plexus.util.StringUtils; /** * Handles injection of plugin executions induced by the lifecycle bindings for a packaging. @@ -66,46 +64,13 @@ public class DefaultLifecycleBindingsInjector { try { - final Set<String> phases = new HashSet<>(); - - if ( request.getGoals() != null ) - { - if ( !request.getGoals().isEmpty() ) - { - // Command line goals. - for ( final String goal : request.getGoals() ) - { - if ( !this.isGoalSpecification( goal ) ) - { - phases.add( goal ); - } - } - } - else if ( model.getBuild() != null && model.getBuild().getDefaultGoal() != null ) - { - // No command line goals -> default goal(s). - // Copied from 'DefaultLifecycleTaskSegmentCalculator'. - if ( !StringUtils.isEmpty( model.getBuild().getDefaultGoal() ) ) - { - for ( final String goal - : Arrays.asList( StringUtils.split( model.getBuild().getDefaultGoal() ) ) ) - { - if ( !this.isGoalSpecification( goal ) ) - { - phases.add( goal ); - } - } - } - } - } - // MNG-5359: request.setGoals() may not have been called since the goals got added for MNG-5359 in 3.4. In // this case fall back to the pre 3.4 behaviour. Usages of ProjectBuildingRequest and // ModelBuildingRequest without setting the goals should behave the same way as before. final Collection<Plugin> defaultPlugins = request.getGoals() == null ? lifecyclePluginAnalyzer.getPluginsBoundByDefaultToAllLifecycles( model.getPackaging() ) - : lifecyclePluginAnalyzer.getPlugins( model.getPackaging(), phases ); + : lifecyclePluginAnalyzer.getDefaultBuildPlugins( model, new HashSet<>( request.getGoals() ) ); if ( !defaultPlugins.isEmpty() ) { @@ -126,12 +91,6 @@ public class DefaultLifecycleBindingsInjector } } - // Copied from 'DefaultLifecycleTaskSegmentCalculator'. - private boolean isGoalSpecification( String task ) - { - return task.indexOf( ':' ) >= 0; - } - protected static class LifecycleBindingsMerger extends MavenModelMerger { http://git-wip-us.apache.org/repos/asf/maven/blob/901b1e8e/maven-core/src/test/java/org/apache/maven/lifecycle/EmptyLifecyclePluginAnalyzer.java ---------------------------------------------------------------------- diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/EmptyLifecyclePluginAnalyzer.java b/maven-core/src/test/java/org/apache/maven/lifecycle/EmptyLifecyclePluginAnalyzer.java index b0df34d..5106fd9 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/EmptyLifecyclePluginAnalyzer.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/EmptyLifecyclePluginAnalyzer.java @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; +import org.apache.maven.model.Model; import org.apache.maven.model.Plugin; import org.apache.maven.model.PluginExecution; @@ -32,6 +33,7 @@ import org.apache.maven.model.PluginExecution; public class EmptyLifecyclePluginAnalyzer implements LifeCyclePluginAnalyzer { + public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ) { Set<Plugin> plugins; @@ -57,7 +59,7 @@ public class EmptyLifecyclePluginAnalyzer } @Override - public Set<Plugin> getPlugins( final String packaging, final Set<String> phases ) + public Set<Plugin> getDefaultBuildPlugins( final Model model, final Set<String> goals ) { return Collections.emptySet(); } @@ -79,4 +81,5 @@ public class EmptyLifecyclePluginAnalyzer return plugin; } + } http://git-wip-us.apache.org/repos/asf/maven/blob/901b1e8e/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifeCyclePluginAnalyzerStub.java ---------------------------------------------------------------------- diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifeCyclePluginAnalyzerStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifeCyclePluginAnalyzerStub.java index 8372179..75d7923 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifeCyclePluginAnalyzerStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifeCyclePluginAnalyzerStub.java @@ -15,20 +15,22 @@ package org.apache.maven.lifecycle.internal.stub; -import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer; -import org.apache.maven.model.Plugin; -import org.apache.maven.model.PluginExecution; - import java.util.Collections; import java.util.LinkedHashSet; import java.util.Set; +import org.apache.maven.lifecycle.LifeCyclePluginAnalyzer; +import org.apache.maven.model.Model; +import org.apache.maven.model.Plugin; +import org.apache.maven.model.PluginExecution; + /** * @author Kristian Rosenvold */ public class LifeCyclePluginAnalyzerStub implements LifeCyclePluginAnalyzer { + public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging ) { Set<Plugin> plugins; @@ -54,7 +56,7 @@ public class LifeCyclePluginAnalyzerStub } @Override - public Set<Plugin> getPlugins( final String packaging, final Set<String> phases ) + public Set<Plugin> getDefaultBuildPlugins( final Model model, final Set<String> goals ) { return Collections.emptySet(); }
