Class DelegatingIdeWorkspaceReader
- java.lang.Object
-
- org.apache.maven.AbstractMavenLifecycleParticipant
-
- de.syquel.maven.reactorstate.extension.workspacereader.DelegatingIdeWorkspaceReader
-
- All Implemented Interfaces:
org.eclipse.aether.repository.WorkspaceReader
@Named("ide") @Singleton @Priority(2147483647) public class DelegatingIdeWorkspaceReader extends org.apache.maven.AbstractMavenLifecycleParticipant implements org.eclipse.aether.repository.WorkspaceReaderA MavenWorkspaceReader, which registers itself with the current Maven execution and delegates to other registered workspace readers. The reason for this workspace reader implementation is that Maven only uses one workspace reader, which might conflict in case an IDE registers its own besides ours.
-
-
Constructor Summary
Constructors Constructor Description DelegatingIdeWorkspaceReader(org.codehaus.plexus.PlexusContainer plexusContainer)Constructs a new Workspace reader based on the Maven dependency injection container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterSessionStart(org.apache.maven.execution.MavenSession session)Retrieves other workspace readers from thePlexusContainer.FilefindArtifact(org.eclipse.aether.artifact.Artifact artifact)Delegates to other workspace readers to determine the filesystem location of a Maven artifact.List<String>findVersions(org.eclipse.aether.artifact.Artifact artifact)Delegates to other workspace readers to determine the available versions of a Maven artifact.org.eclipse.aether.repository.WorkspaceRepositorygetRepository()Returns the underlying workspace repository information.
-
-
-
Constructor Detail
-
DelegatingIdeWorkspaceReader
@Inject public DelegatingIdeWorkspaceReader(org.codehaus.plexus.PlexusContainer plexusContainer)
Constructs a new Workspace reader based on the Maven dependency injection container.- Parameters:
plexusContainer- The Maven dependency injection and management container to retrieve other workspace reader implementations from.
-
-
Method Detail
-
afterSessionStart
public void afterSessionStart(org.apache.maven.execution.MavenSession session) throws org.apache.maven.MavenExecutionExceptionRetrieves other workspace readers from thePlexusContainer. This is a Maven lifecycle hook, which is executed directly after the Maven session has been constructed, but before it has started or projects were read.- Overrides:
afterSessionStartin classorg.apache.maven.AbstractMavenLifecycleParticipant- Parameters:
session- The current Maven execution.- Throws:
org.apache.maven.MavenExecutionException- if other workspace readers could not be retrieved from thePlexusContainer.
-
findArtifact
public File findArtifact(org.eclipse.aether.artifact.Artifact artifact)
Delegates to other workspace readers to determine 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)
Delegates to other workspace readers to determine 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.
-
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.
-
-