Class 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.WorkspaceReader
    A Maven WorkspaceReader, 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
      void afterSessionStart​(org.apache.maven.execution.MavenSession session)
      Retrieves other workspace readers from the PlexusContainer.
      File findArtifact​(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.WorkspaceRepository getRepository()
      Returns the underlying workspace repository information.
      • Methods inherited from class org.apache.maven.AbstractMavenLifecycleParticipant

        afterProjectsRead, afterSessionEnd
    • 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.MavenExecutionException
        Retrieves other workspace readers from the PlexusContainer. 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:
        afterSessionStart in class org.apache.maven.AbstractMavenLifecycleParticipant
        Parameters:
        session - The current Maven execution.
        Throws:
        org.apache.maven.MavenExecutionException - if other workspace readers could not be retrieved from the PlexusContainer.
      • 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:
        findArtifact in interface org.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:
        findVersions in interface org.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:
        getRepository in interface org.eclipse.aether.repository.WorkspaceReader
        Returns:
        The underlying workspace repository information.