Class DefaultLifecycleExecutionPlanCalculator
java.lang.Object
org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator
- All Implemented Interfaces:
LifecycleExecutionPlanCalculator
@Named
@Singleton
public class DefaultLifecycleExecutionPlanCalculator
extends Object
implements LifecycleExecutionPlanCalculator
NOTE: This class is not part of any public api and can be changed or deleted without prior notice.
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DefaultLifecycles
private final Map
<String, LifecycleMappingDelegate> private final LifecyclePluginResolver
private final MojoDescriptorCreator
private final Map
<String, MojoExecutionConfigurator> private final BuildPluginManager
private final LifecycleMappingDelegate
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultLifecycleExecutionPlanCalculator
(BuildPluginManager pluginManager, DefaultLifecycles defaultLifecycles, MojoDescriptorCreator mojoDescriptorCreator, LifecyclePluginResolver lifecyclePluginResolver) DefaultLifecycleExecutionPlanCalculator
(BuildPluginManager pluginManager, DefaultLifecycles defaultLifecycles, MojoDescriptorCreator mojoDescriptorCreator, LifecyclePluginResolver lifecyclePluginResolver, LifecycleMappingDelegate standardDelegate, Map<String, LifecycleMappingDelegate> delegates, Map<String, MojoExecutionConfigurator> mojoExecutionConfigurators) -
Method Summary
Modifier and TypeMethodDescriptioncalculateExecutionPlan
(MavenSession session, MavenProject project, List<Task> tasks) calculateExecutionPlan
(MavenSession session, MavenProject project, List<Task> tasks, boolean setup) void
calculateForkedExecutions
(MojoExecution mojoExecution, MavenSession session) private void
calculateForkedExecutions
(MojoExecution mojoExecution, MavenSession session, MavenProject project, Collection<MojoDescriptor> alreadyPlannedExecutions) private List
<MojoExecution> calculateForkedGoal
(MojoExecution mojoExecution, MavenSession session, MavenProject project, Collection<MojoDescriptor> alreadyPlannedExecutions) private List
<MojoExecution> calculateForkedLifecycle
(MojoExecution mojoExecution, MavenSession session, MavenProject project, Collection<MojoDescriptor> alreadyPlannedExecutions) private Map
<String, List<MojoExecution>> calculateLifecycleMappings
(MavenSession session, MavenProject project, String lifecyclePhase) calculateMojoExecutions
(MavenSession session, MavenProject project, List<Task> tasks) private MojoDescriptor
fillMojoDescriptor
(MavenSession session, MavenProject project, MojoExecution execution) private Set
<MojoDescriptor> fillMojoDescriptors
(MavenSession session, MavenProject project, List<MojoExecution> mojoExecutions) private void
finalizeMojoConfiguration
(MojoExecution mojoExecution) Post-processes the effective configuration for the specified mojo execution.private XmlNode
getMojoConfiguration
(MojoDescriptor mojoDescriptor) private void
injectLifecycleOverlay
(Map<String, List<MojoExecution>> lifecycleMappings, MojoExecution mojoExecution, MavenSession session, MavenProject project) private MojoExecutionConfigurator
mojoExecutionConfigurator
(MojoExecution mojoExecution) void
setupMojoExecution
(MavenSession session, MavenProject project, MojoExecution mojoExecution, Set<MojoDescriptor> alreadyPlannedExecutions) private void
setupMojoExecutions
(MavenSession session, MavenProject project, List<MojoExecution> mojoExecutions)
-
Field Details
-
pluginManager
-
defaultLifecycles
-
mojoDescriptorCreator
-
lifecyclePluginResolver
-
standardDelegate
-
delegates
-
mojoExecutionConfigurators
-
-
Constructor Details
-
DefaultLifecycleExecutionPlanCalculator
@Inject public DefaultLifecycleExecutionPlanCalculator(BuildPluginManager pluginManager, DefaultLifecycles defaultLifecycles, MojoDescriptorCreator mojoDescriptorCreator, LifecyclePluginResolver lifecyclePluginResolver, @Named("default") LifecycleMappingDelegate standardDelegate, Map<String, LifecycleMappingDelegate> delegates, Map<String, MojoExecutionConfigurator> mojoExecutionConfigurators) -
DefaultLifecycleExecutionPlanCalculator
public DefaultLifecycleExecutionPlanCalculator(BuildPluginManager pluginManager, DefaultLifecycles defaultLifecycles, MojoDescriptorCreator mojoDescriptorCreator, LifecyclePluginResolver lifecyclePluginResolver)
-
-
Method Details
-
calculateExecutionPlan
public MavenExecutionPlan calculateExecutionPlan(MavenSession session, MavenProject project, List<Task> tasks, boolean setup) throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException - Specified by:
calculateExecutionPlan
in interfaceLifecycleExecutionPlanCalculator
- Throws:
PluginNotFoundException
PluginResolutionException
LifecyclePhaseNotFoundException
PluginDescriptorParsingException
MojoNotFoundException
InvalidPluginDescriptorException
NoPluginFoundForPrefixException
LifecycleNotFoundException
PluginVersionResolutionException
-
calculateExecutionPlan
public MavenExecutionPlan calculateExecutionPlan(MavenSession session, MavenProject project, List<Task> tasks) throws PluginNotFoundException, PluginResolutionException, LifecyclePhaseNotFoundException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, LifecycleNotFoundException, PluginVersionResolutionException - Specified by:
calculateExecutionPlan
in interfaceLifecycleExecutionPlanCalculator
- Throws:
PluginNotFoundException
PluginResolutionException
LifecyclePhaseNotFoundException
PluginDescriptorParsingException
MojoNotFoundException
InvalidPluginDescriptorException
NoPluginFoundForPrefixException
LifecycleNotFoundException
PluginVersionResolutionException
-
setupMojoExecutions
private void setupMojoExecutions(MavenSession session, MavenProject project, List<MojoExecution> mojoExecutions) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException -
fillMojoDescriptors
private Set<MojoDescriptor> fillMojoDescriptors(MavenSession session, MavenProject project, List<MojoExecution> mojoExecutions) throws InvalidPluginDescriptorException, MojoNotFoundException, PluginResolutionException, PluginDescriptorParsingException, PluginNotFoundException -
fillMojoDescriptor
private MojoDescriptor fillMojoDescriptor(MavenSession session, MavenProject project, MojoExecution execution) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException -
setupMojoExecution
public void setupMojoExecution(MavenSession session, MavenProject project, MojoExecution mojoExecution, Set<MojoDescriptor> alreadyPlannedExecutions) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException - Specified by:
setupMojoExecution
in interfaceLifecycleExecutionPlanCalculator
- Throws:
PluginNotFoundException
PluginResolutionException
PluginDescriptorParsingException
MojoNotFoundException
InvalidPluginDescriptorException
NoPluginFoundForPrefixException
LifecyclePhaseNotFoundException
LifecycleNotFoundException
PluginVersionResolutionException
-
calculateMojoExecutions
public List<MojoExecution> calculateMojoExecutions(MavenSession session, MavenProject project, List<Task> tasks) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, PluginVersionResolutionException, LifecyclePhaseNotFoundException -
calculateLifecycleMappings
private Map<String,List<MojoExecution>> calculateLifecycleMappings(MavenSession session, MavenProject project, String lifecyclePhase) throws LifecyclePhaseNotFoundException, PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException -
finalizeMojoConfiguration
Post-processes the effective configuration for the specified mojo execution. This step discards all parameters from the configuration that are not applicable to the mojo and injects the default values for any missing parameters.- Parameters:
mojoExecution
- The mojo execution whose configuration should be finalized, must not benull
.
-
getMojoConfiguration
-
calculateForkedExecutions
public void calculateForkedExecutions(MojoExecution mojoExecution, MavenSession session) throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException - Specified by:
calculateForkedExecutions
in interfaceLifecycleExecutionPlanCalculator
- Throws:
MojoNotFoundException
PluginNotFoundException
PluginResolutionException
PluginDescriptorParsingException
NoPluginFoundForPrefixException
InvalidPluginDescriptorException
LifecyclePhaseNotFoundException
LifecycleNotFoundException
PluginVersionResolutionException
-
calculateForkedExecutions
private void calculateForkedExecutions(MojoExecution mojoExecution, MavenSession session, MavenProject project, Collection<MojoDescriptor> alreadyPlannedExecutions) throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException -
calculateForkedLifecycle
private List<MojoExecution> calculateForkedLifecycle(MojoExecution mojoExecution, MavenSession session, MavenProject project, Collection<MojoDescriptor> alreadyPlannedExecutions) throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException -
injectLifecycleOverlay
private void injectLifecycleOverlay(Map<String, List<MojoExecution>> lifecycleMappings, MojoExecution mojoExecution, MavenSession session, MavenProject project) throws PluginDescriptorParsingException, LifecycleNotFoundException, MojoNotFoundException, PluginNotFoundException, PluginResolutionException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, PluginVersionResolutionException -
calculateForkedGoal
private List<MojoExecution> calculateForkedGoal(MojoExecution mojoExecution, MavenSession session, MavenProject project, Collection<MojoDescriptor> alreadyPlannedExecutions) throws MojoNotFoundException, PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException -
mojoExecutionConfigurator
-