Class ReactorStateSaveExtension
- java.lang.Object
-
- org.apache.maven.AbstractMavenLifecycleParticipant
-
- de.syquel.maven.reactorstate.extension.ReactorStateSaveExtension
-
@Named("reactorstate-save") @Singleton public class ReactorStateSaveExtension extends org.apache.maven.AbstractMavenLifecycleParticipantA Maven Core Extension which saves the state of Maven executions afterwards and restores it beforehand.
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXTENSION_IDThe unique ID of this Maven Core Extension.
-
Constructor Summary
Constructors Constructor Description ReactorStateSaveExtension(org.apache.maven.project.MavenProjectHelper projectHelper, org.apache.maven.project.ProjectBuilder projectBuilder)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterProjectsRead(org.apache.maven.execution.MavenSession session)Restores the saved state of the Maven projects and its Maven modules within the current Maven execution.voidafterSessionEnd(org.apache.maven.execution.MavenSession session)Saves the current state of all Maven modules within the Maven execution.
-
-
-
Field Detail
-
EXTENSION_ID
public static final String EXTENSION_ID
The unique ID of this Maven Core Extension.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReactorStateSaveExtension
@Inject public ReactorStateSaveExtension(org.apache.maven.project.MavenProjectHelper projectHelper, org.apache.maven.project.ProjectBuilder projectBuilder)Constructs a new instance.- Parameters:
projectHelper- The helper for Maven-related operations on the current state.projectBuilder- The builder for Maven projects from POMs.
-
-
Method Detail
-
afterProjectsRead
public void afterProjectsRead(org.apache.maven.execution.MavenSession session) throws org.apache.maven.MavenExecutionExceptionRestores the saved state of the Maven projects and its Maven modules within the current Maven execution.- Overrides:
afterProjectsReadin classorg.apache.maven.AbstractMavenLifecycleParticipant- Parameters:
session- The current Maven execution.- Throws:
org.apache.maven.MavenExecutionException- if an error occurred while restoring the saved state.
-
afterSessionEnd
public void afterSessionEnd(org.apache.maven.execution.MavenSession session) throws org.apache.maven.MavenExecutionExceptionSaves the current state of all Maven modules within the Maven execution. This is a Maven lifecycle hook, which is executed directly after the Maven session has read the project definitions of the Maven modules, but before it has started building the project.- Overrides:
afterSessionEndin classorg.apache.maven.AbstractMavenLifecycleParticipant- Parameters:
session- The current Maven execution.- Throws:
org.apache.maven.MavenExecutionException- if an error occurred while saving the current state.
-
-