Class MavenRegistryArtifactResolverWithCleanup

java.lang.Object
io.quarkus.registry.client.maven.MavenRegistryArtifactResolverWithCleanup
All Implemented Interfaces:
MavenRegistryArtifactResolver

public class MavenRegistryArtifactResolverWithCleanup extends Object implements MavenRegistryArtifactResolver
  • Constructor Details

    • MavenRegistryArtifactResolverWithCleanup

      public MavenRegistryArtifactResolverWithCleanup(io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver resolver, boolean cleanupOldTimestampedVersions)
  • Method Details

    • resolveArtifact

      public org.eclipse.aether.resolution.ArtifactResult resolveArtifact(org.eclipse.aether.artifact.Artifact artifact) throws io.quarkus.bootstrap.resolver.maven.BootstrapMavenException
      Specified by:
      resolveArtifact in interface MavenRegistryArtifactResolver
      Throws:
      io.quarkus.bootstrap.resolver.maven.BootstrapMavenException
    • findArtifactDirectory

      public Path findArtifactDirectory(org.eclipse.aether.artifact.Artifact artifact) throws io.quarkus.bootstrap.resolver.maven.BootstrapMavenException
      Specified by:
      findArtifactDirectory in interface MavenRegistryArtifactResolver
      Throws:
      io.quarkus.bootstrap.resolver.maven.BootstrapMavenException
    • getLatestVersionFromRange

      public String getLatestVersionFromRange(org.eclipse.aether.artifact.Artifact artifact, String versionRange) throws io.quarkus.bootstrap.resolver.maven.BootstrapMavenException
      Specified by:
      getLatestVersionFromRange in interface MavenRegistryArtifactResolver
      Throws:
      io.quarkus.bootstrap.resolver.maven.BootstrapMavenException
    • resolveAndCleanupOldTimestampedVersions

      protected static org.eclipse.aether.resolution.ArtifactResult resolveAndCleanupOldTimestampedVersions(io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver resolver, org.eclipse.aether.artifact.Artifact artifact, boolean cleanupOldTimestampedVersions) throws io.quarkus.bootstrap.resolver.maven.BootstrapMavenException
      This method resolves an artifact and then will attempt to remove old timestamped SNAPSHOT versions.

      IMPORTANT: it does not remove all the timestamped SNAPSHOT versions because otherwise, the artifacts will always be resolved from a remote repository even if the update policy does not require that.

      Parameters:
      resolver - Maven artifact resolver
      artifact - artifact to resolve
      cleanupOldTimestampedVersions - whether to remove old timestamped SNAPSHOT versions
      Returns:
      artifact resolution result
      Throws:
      io.quarkus.bootstrap.resolver.maven.BootstrapMavenException - in case the artifact could not be resolved
    • resolveMetadata

      public org.apache.maven.artifact.repository.metadata.Metadata resolveMetadata(org.eclipse.aether.resolution.ArtifactResult result) throws io.quarkus.bootstrap.resolver.maven.BootstrapMavenException
      Specified by:
      resolveMetadata in interface MavenRegistryArtifactResolver
      Throws:
      io.quarkus.bootstrap.resolver.maven.BootstrapMavenException