Package org.apache.maven.buildcache
Class LifecyclePhasesHelper
- java.lang.Object
-
- org.apache.maven.execution.AbstractExecutionListener
-
- org.apache.maven.buildcache.LifecyclePhasesHelper
-
- All Implemented Interfaces:
org.apache.maven.execution.ExecutionListener
@Named public class LifecyclePhasesHelper extends org.apache.maven.execution.AbstractExecutionListener
-
-
Constructor Summary
Constructors Constructor Description LifecyclePhasesHelper(org.apache.maven.execution.MavenSession session, org.apache.maven.lifecycle.DefaultLifecycles defaultLifecycles, org.apache.maven.lifecycle.Lifecycle cleanLifecycle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forkedProjectFailed(org.apache.maven.execution.ExecutionEvent event)
void
forkedProjectStarted(org.apache.maven.execution.ExecutionEvent event)
void
forkedProjectSucceeded(org.apache.maven.execution.ExecutionEvent event)
List<org.apache.maven.plugin.MojoExecution>
getCachedSegment(org.apache.maven.project.MavenProject project, List<org.apache.maven.plugin.MojoExecution> mojoExecutions, Build build)
Computes the list of mojos executions that are cached.List<org.apache.maven.plugin.MojoExecution>
getCleanSegment(org.apache.maven.project.MavenProject project, List<org.apache.maven.plugin.MojoExecution> mojoExecutions)
Computes the list of mojos executions in the clean phaseList<org.apache.maven.plugin.MojoExecution>
getPostCachedSegment(org.apache.maven.project.MavenProject project, List<org.apache.maven.plugin.MojoExecution> mojoExecutions, Build build)
Computes the list of mojos executions that will have to be executed after cache restoration.void
init()
boolean
isForkedProject(org.apache.maven.project.MavenProject project)
boolean
isLaterPhase(String phase, String other)
Check if the given phase is later than the other in maven lifecycle.boolean
isLaterPhaseThanBuild(String phase, Build build)
boolean
isLaterPhaseThanClean(String phase)
Check if the given phase is later than the clean lifecycle.String
resolveHighestLifecyclePhase(org.apache.maven.project.MavenProject project, List<org.apache.maven.plugin.MojoExecution> mojoExecutions)
-
-
-
Method Detail
-
init
@PostConstruct public void init()
-
forkedProjectStarted
public void forkedProjectStarted(org.apache.maven.execution.ExecutionEvent event)
- Specified by:
forkedProjectStarted
in interfaceorg.apache.maven.execution.ExecutionListener
- Overrides:
forkedProjectStarted
in classorg.apache.maven.execution.AbstractExecutionListener
-
forkedProjectSucceeded
public void forkedProjectSucceeded(org.apache.maven.execution.ExecutionEvent event)
- Specified by:
forkedProjectSucceeded
in interfaceorg.apache.maven.execution.ExecutionListener
- Overrides:
forkedProjectSucceeded
in classorg.apache.maven.execution.AbstractExecutionListener
-
forkedProjectFailed
public void forkedProjectFailed(org.apache.maven.execution.ExecutionEvent event)
- Specified by:
forkedProjectFailed
in interfaceorg.apache.maven.execution.ExecutionListener
- Overrides:
forkedProjectFailed
in classorg.apache.maven.execution.AbstractExecutionListener
-
resolveHighestLifecyclePhase
@Nonnull public String resolveHighestLifecyclePhase(org.apache.maven.project.MavenProject project, List<org.apache.maven.plugin.MojoExecution> mojoExecutions)
-
isLaterPhaseThanClean
public boolean isLaterPhaseThanClean(String phase)
Check if the given phase is later than the clean lifecycle.
-
isLaterPhase
public boolean isLaterPhase(String phase, String other)
Check if the given phase is later than the other in maven lifecycle. Example: isLaterPhase("install", "clean") returns true;
-
getCleanSegment
public List<org.apache.maven.plugin.MojoExecution> getCleanSegment(org.apache.maven.project.MavenProject project, List<org.apache.maven.plugin.MojoExecution> mojoExecutions)
Computes the list of mojos executions in the clean phase
-
getCachedSegment
public List<org.apache.maven.plugin.MojoExecution> getCachedSegment(org.apache.maven.project.MavenProject project, List<org.apache.maven.plugin.MojoExecution> mojoExecutions, Build build)
Computes the list of mojos executions that are cached.
-
getPostCachedSegment
public List<org.apache.maven.plugin.MojoExecution> getPostCachedSegment(org.apache.maven.project.MavenProject project, List<org.apache.maven.plugin.MojoExecution> mojoExecutions, Build build)
Computes the list of mojos executions that will have to be executed after cache restoration.
-
isForkedProject
public boolean isForkedProject(org.apache.maven.project.MavenProject project)
-
-