Class ReverseTreeRepositoryListener

java.lang.Object
org.eclipse.aether.AbstractRepositoryListener
org.apache.maven.internal.aether.ReverseTreeRepositoryListener
All Implemented Interfaces:
org.eclipse.aether.RepositoryListener

class ReverseTreeRepositoryListener extends org.eclipse.aether.AbstractRepositoryListener
A class building reverse tree using CollectStepData trace data provided in RepositoryEvent events fired during collection.
Since:
3.9.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    artifactResolved(org.eclipse.aether.RepositoryEvent event)
     
    (package private) static boolean
    isInScope(org.eclipse.aether.artifact.Artifact artifact, org.eclipse.aether.artifact.Artifact nodeArtifact)
    The event "artifact resolved" if fired WHENEVER an artifact is resolved, BUT it happens also when an artifact descriptor (model, the POM) is being built, and parent (and parent of parent...) is being asked for.
    (package private) static boolean
    isLocalRepositoryArtifactOrMissing(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.artifact.Artifact artifact)
    Returns true if passed in artifact is originating from local repository.
    (package private) static org.eclipse.aether.collection.CollectStepData
    lookupCollectStepData(org.eclipse.aether.RequestTrace trace)
    Unravels trace tree (going upwards from current node), looking for CollectStepData trace data.

    Methods inherited from class org.eclipse.aether.AbstractRepositoryListener

    artifactDeployed, artifactDeploying, artifactDescriptorInvalid, artifactDescriptorMissing, artifactDownloaded, artifactDownloading, artifactInstalled, artifactInstalling, artifactResolving, metadataDeployed, metadataDeploying, metadataDownloaded, metadataDownloading, metadataInstalled, metadataInstalling, metadataInvalid, metadataResolved, metadataResolving

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReverseTreeRepositoryListener

      ReverseTreeRepositoryListener()
  • Method Details

    • artifactResolved

      public void artifactResolved(org.eclipse.aether.RepositoryEvent event)
      Specified by:
      artifactResolved in interface org.eclipse.aether.RepositoryListener
      Overrides:
      artifactResolved in class org.eclipse.aether.AbstractRepositoryListener
    • isLocalRepositoryArtifactOrMissing

      static boolean isLocalRepositoryArtifactOrMissing(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.artifact.Artifact artifact)
      Returns true if passed in artifact is originating from local repository. In other words, we want to process and store tracking information ONLY into local repository, not to any other place. This method filters out currently built artifacts, as events are fired for them as well, but their resolved artifact file would point to checked out source-tree, not the local repository.

      Visible for testing.

    • lookupCollectStepData

      static org.eclipse.aether.collection.CollectStepData lookupCollectStepData(org.eclipse.aether.RequestTrace trace)
      Unravels trace tree (going upwards from current node), looking for CollectStepData trace data. This method may return null if no collect step data found in passed trace data or it's parents.

      Visible for testing.

    • isInScope

      static boolean isInScope(org.eclipse.aether.artifact.Artifact artifact, org.eclipse.aether.artifact.Artifact nodeArtifact)
      The event "artifact resolved" if fired WHENEVER an artifact is resolved, BUT it happens also when an artifact descriptor (model, the POM) is being built, and parent (and parent of parent...) is being asked for. Hence, this method "filters" out in WHICH artifact are we interested in, but it intentionally neglects extension as ArtifactDescriptorReader modifies extension to "pom" during collect. So all we have to rely on is GAV only.