Class ReactorReader

  • All Implemented Interfaces:
    MavenWorkspaceReader, org.eclipse.aether.repository.WorkspaceReader

    @Named("reactor")
    class ReactorReader
    extends java.lang.Object
    implements MavenWorkspaceReader
    An implementation of a workspace reader that knows how to search the Maven reactor for artifacts, either as packaged jar if it has been built, or only compile output directory if packaging hasn't happened yet.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean attachedArtifactComparison​(org.eclipse.aether.artifact.Artifact requested, org.eclipse.aether.artifact.Artifact attached)  
      private java.io.File find​(MavenProject project, org.eclipse.aether.artifact.Artifact artifact)  
      java.io.File findArtifact​(org.eclipse.aether.artifact.Artifact artifact)  
      private org.eclipse.aether.artifact.Artifact findMatchingArtifact​(MavenProject project, org.eclipse.aether.artifact.Artifact requestedArtifact)
      Tries to resolve the specified artifact from the artifacts of the given project.
      Model findModel​(org.eclipse.aether.artifact.Artifact artifact)  
      java.util.List<java.lang.String> findVersions​(org.eclipse.aether.artifact.Artifact artifact)  
      org.eclipse.aether.repository.WorkspaceRepository getRepository()  
      private boolean hasArtifactFileFromPackagePhase​(org.eclipse.aether.artifact.Artifact projectArtifact)  
      private boolean hasBeenPackaged​(MavenProject project)  
      private static boolean isTestArtifact​(org.eclipse.aether.artifact.Artifact artifact)
      Determines whether the specified artifact refers to test classes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COMPILE_PHASE_TYPES

        private static final java.util.Collection<java.lang.String> COMPILE_PHASE_TYPES
      • projectsByGAV

        private java.util.Map<java.lang.String,​MavenProject> projectsByGAV
      • projectsByGA

        private java.util.Map<java.lang.String,​java.util.List<MavenProject>> projectsByGA
      • repository

        private org.eclipse.aether.repository.WorkspaceRepository repository
    • Constructor Detail

      • ReactorReader

        @Inject
        ReactorReader​(MavenSession session)
    • Method Detail

      • getRepository

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

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

        public java.util.List<java.lang.String> findVersions​(org.eclipse.aether.artifact.Artifact artifact)
        Specified by:
        findVersions in interface org.eclipse.aether.repository.WorkspaceReader
      • find

        private java.io.File find​(MavenProject project,
                                  org.eclipse.aether.artifact.Artifact artifact)
      • hasArtifactFileFromPackagePhase

        private boolean hasArtifactFileFromPackagePhase​(org.eclipse.aether.artifact.Artifact projectArtifact)
      • hasBeenPackaged

        private boolean hasBeenPackaged​(MavenProject project)
      • findMatchingArtifact

        private org.eclipse.aether.artifact.Artifact findMatchingArtifact​(MavenProject project,
                                                                          org.eclipse.aether.artifact.Artifact requestedArtifact)
        Tries to resolve the specified artifact from the artifacts of the given project.
        Parameters:
        project - The project to try to resolve the artifact from, must not be null.
        requestedArtifact - The artifact to resolve, must not be null.
        Returns:
        The matching artifact from the project or null if not found. Note that this
      • attachedArtifactComparison

        private boolean attachedArtifactComparison​(org.eclipse.aether.artifact.Artifact requested,
                                                   org.eclipse.aether.artifact.Artifact attached)
      • isTestArtifact

        private static boolean isTestArtifact​(org.eclipse.aether.artifact.Artifact artifact)
        Determines whether the specified artifact refers to test classes.
        Parameters:
        artifact - The artifact to check, must not be null.
        Returns:
        true if the artifact refers to test classes, false otherwise.