Class MavenChainedWorkspaceReader

java.lang.Object
org.apache.maven.resolver.MavenChainedWorkspaceReader
All Implemented Interfaces:
MavenWorkspaceReader, org.eclipse.aether.repository.WorkspaceReader

public class MavenChainedWorkspaceReader extends Object implements MavenWorkspaceReader
A maven workspace reader that delegates to a chain of other readers, effectively aggregating their contents.

This class, while technically is not immutable, should be considered as such once set up. If not mutated, it is also thread-safe. The mutation of this class instances should happen beforehand their use in session.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<org.eclipse.aether.repository.WorkspaceReader>
     
    protected org.eclipse.aether.repository.WorkspaceRepository
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    MavenChainedWorkspaceReader(org.eclipse.aether.repository.WorkspaceReader... readers)
    Creates a new workspace reader by chaining the specified readers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addReader(org.eclipse.aether.repository.WorkspaceReader workspaceReader)
     
    findArtifact(org.eclipse.aether.artifact.Artifact artifact)
     
    org.apache.maven.api.model.Model
    findModel(org.eclipse.aether.artifact.Artifact artifact)
     
    findVersions(org.eclipse.aether.artifact.Artifact artifact)
     
    List<org.eclipse.aether.repository.WorkspaceReader>
     
    org.eclipse.aether.repository.WorkspaceRepository
     
    static org.eclipse.aether.repository.WorkspaceReader
    of(Collection<org.eclipse.aether.repository.WorkspaceReader> workspaceReaderCollection)
    chains a collection of WorkspaceReaders
    void
    setReaders(Collection<org.eclipse.aether.repository.WorkspaceReader> readers)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.eclipse.aether.repository.WorkspaceReader

    findArtifactPath
  • Field Details

    • readers

      protected List<org.eclipse.aether.repository.WorkspaceReader> readers
    • repository

      protected org.eclipse.aether.repository.WorkspaceRepository repository
  • Constructor Details

    • MavenChainedWorkspaceReader

      public MavenChainedWorkspaceReader(org.eclipse.aether.repository.WorkspaceReader... readers)
      Creates a new workspace reader by chaining the specified readers.
      Parameters:
      readers - The readers to chain must not be null.
  • Method Details

    • getRepository

      public org.eclipse.aether.repository.WorkspaceRepository getRepository()
      Specified by:
      getRepository in interface org.eclipse.aether.repository.WorkspaceReader
    • findModel

      public org.apache.maven.api.model.Model findModel(org.eclipse.aether.artifact.Artifact artifact)
      Specified by:
      findModel in interface MavenWorkspaceReader
    • findArtifact

      public File findArtifact(org.eclipse.aether.artifact.Artifact artifact)
      Specified by:
      findArtifact in interface org.eclipse.aether.repository.WorkspaceReader
    • findVersions

      public List<String> findVersions(org.eclipse.aether.artifact.Artifact artifact)
      Specified by:
      findVersions in interface org.eclipse.aether.repository.WorkspaceReader
    • setReaders

      public void setReaders(Collection<org.eclipse.aether.repository.WorkspaceReader> readers)
    • getReaders

      public List<org.eclipse.aether.repository.WorkspaceReader> getReaders()
    • addReader

      public void addReader(org.eclipse.aether.repository.WorkspaceReader workspaceReader)
    • of

      public static org.eclipse.aether.repository.WorkspaceReader of(Collection<org.eclipse.aether.repository.WorkspaceReader> workspaceReaderCollection)
      chains a collection of WorkspaceReaders
      Parameters:
      workspaceReaderCollection - the collection of readers, might be empty but never null
      Returns:
      if the collection contains only one item returns the single item, otherwise creates a new MavenChainedWorkspaceReader chaining all readers in the order of the given collection.