Class ReactorStateWorkspaceReader
- java.lang.Object
-
- org.apache.maven.AbstractMavenLifecycleParticipant
-
- de.syquel.maven.reactorstate.extension.workspacereader.ReactorStateWorkspaceReader
-
- All Implemented Interfaces:
org.eclipse.aether.repository.WorkspaceReader
@Named("ide") @Singleton public class ReactorStateWorkspaceReader extends org.apache.maven.AbstractMavenLifecycleParticipant implements org.eclipse.aether.repository.WorkspaceReaderA MavenWorkspaceReader, which contributes Maven artifacts from the current Maven workspace based on their saved state to the current Maven execution. This workspace reader is able to restore the state of Maven modules, which are not being built in the current Maven execution, but belong to the same Maven workspace, to enable standalone builds of submodules.
-
-
Field Summary
Fields Modifier and Type Field Description static StringWORKSPACE_READER_IDE_QUALIFIERThe Maven-defined qualifier for custom workspace reader implementations.
-
Constructor Summary
Constructors Constructor Description ReactorStateWorkspaceReader(org.apache.maven.project.ProjectBuilder projectBuilder)Constructs a new state-based workspace reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterProjectsRead(org.apache.maven.execution.MavenSession session)Initializes the workspace reader with the saved state of the Maven modules within the current Maven workspace.FilefindArtifact(org.eclipse.aether.artifact.Artifact artifact)Determines the filesystem location of a Maven artifact.List<String>findVersions(org.eclipse.aether.artifact.Artifact artifact)Determines the available versions of a Maven artifact.org.eclipse.aether.repository.WorkspaceRepositorygetRepository()Returns the underlying workspace repository information.
-
-
-
Field Detail
-
WORKSPACE_READER_IDE_QUALIFIER
public static final String WORKSPACE_READER_IDE_QUALIFIER
The Maven-defined qualifier for custom workspace reader implementations.- See Also:
- Constant Field Values
-
-
Method Detail
-
afterProjectsRead
public void afterProjectsRead(org.apache.maven.execution.MavenSession session) throws org.apache.maven.MavenExecutionExceptionInitializes the workspace reader with the saved state of the Maven modules within the current Maven workspace. 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:
afterProjectsReadin classorg.apache.maven.AbstractMavenLifecycleParticipant- Parameters:
session- The current Maven execution.- Throws:
org.apache.maven.MavenExecutionException- if an error occurred while reading the saved state of the Maven modules.
-
getRepository
public org.eclipse.aether.repository.WorkspaceRepository getRepository()
Returns the underlying workspace repository information.- Specified by:
getRepositoryin interfaceorg.eclipse.aether.repository.WorkspaceReader- Returns:
- The underlying workspace repository information.
-
findArtifact
public File findArtifact(org.eclipse.aether.artifact.Artifact artifact)
Determines the filesystem location of a Maven artifact.- Specified by:
findArtifactin interfaceorg.eclipse.aether.repository.WorkspaceReader- Parameters:
artifact- The Maven artifact to determine the filesystem location for.- Returns:
- The filesystem location of the Maven artifact.
-
findVersions
public List<String> findVersions(org.eclipse.aether.artifact.Artifact artifact)
Determines the available versions of a Maven artifact.- Specified by:
findVersionsin interfaceorg.eclipse.aether.repository.WorkspaceReader- Parameters:
artifact- The Maven artifact to determine available version for.- Returns:
- The list of available versions of the Maven artifact.
-
-