Class ArtifactDeferrerImpl

java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.sonatype.central.publisher.plugin.deffer.ArtifactDeferrerImpl
All Implemented Interfaces:
org.codehaus.plexus.logging.LogEnabled, ArtifactDeferrer

@Component(role=ArtifactDeferrer.class) public class ArtifactDeferrerImpl extends org.codehaus.plexus.logging.AbstractLogEnabled implements ArtifactDeferrer
Implementation of ArtifactDeferrer.

Highly inspired by the nexus-maven-plugin, specifically the DeferredDeployStrategy and the AbstractDeployStrategy classes

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Just a "fake" synthetic handler, to overcome Maven2/3 differences (no extension setter in M2 but there is in M3 on DefaultArtifactHandler.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    protected static final String
     
    protected static final Pattern
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ArtifactDeferrerImpl(org.apache.maven.artifact.repository.ArtifactRepositoryFactory artifactRepositoryFactory, org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout artifactRepositoryLayout, org.apache.maven.artifact.installer.ArtifactInstaller artifactInstaller, org.apache.maven.artifact.deployer.ArtifactDeployer artifactDeployer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.maven.artifact.repository.ArtifactRepository
     
    protected org.apache.maven.artifact.repository.ArtifactRepository
     
    void
    deployUp(org.apache.maven.execution.MavenSession mavenSession, File sourceDirectory, org.apache.maven.artifact.repository.ArtifactRepository remoteRepository)
    Deploy artifact.
    protected org.apache.maven.artifact.repository.ArtifactRepository
     
    protected org.apache.maven.artifact.repository.ArtifactRepository
    getDeploymentRepository(org.apache.maven.execution.MavenSession mavenSession, String centralSnapshotsUrl, String publishingServerId)
     
    void
    Installs the artifacts into the staging repository.

    Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled

    enableLogging, getLogger, setupLogger, setupLogger, setupLogger

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • ArtifactDeferrerImpl

      @Inject public ArtifactDeferrerImpl(org.apache.maven.artifact.repository.ArtifactRepositoryFactory artifactRepositoryFactory, org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout artifactRepositoryLayout, org.apache.maven.artifact.installer.ArtifactInstaller artifactInstaller, org.apache.maven.artifact.deployer.ArtifactDeployer artifactDeployer)
  • Method Details

    • install

      public void install(DeferArtifactRequest request) throws org.apache.maven.artifact.installer.ArtifactInstallationException, org.apache.maven.plugin.MojoExecutionException
      Installs the artifacts into the staging repository.
      Specified by:
      install in interface ArtifactDeferrer
      Parameters:
      request - - DeferArtifactRequest
      Throws:
      org.apache.maven.artifact.installer.ArtifactInstallationException - - if the artifact installation fails
      org.apache.maven.plugin.MojoExecutionException - - if the staging directory is null or the artifact repo cannot be created
      See Also:
      • invalid reference
        ArtifactDeferrer#install(File, Artifact, ArtifactRepository, File, ArtifactRepository)
    • deployUp

      public void deployUp(org.apache.maven.execution.MavenSession mavenSession, File sourceDirectory, org.apache.maven.artifact.repository.ArtifactRepository remoteRepository) throws org.apache.maven.artifact.deployer.ArtifactDeploymentException, IOException
      Description copied from interface: ArtifactDeferrer
      Deploy artifact.
      Specified by:
      deployUp in interface ArtifactDeferrer
      Parameters:
      mavenSession - - MavenSession
      sourceDirectory - - File
      remoteRepository - - ArtifactRepository
      Throws:
      org.apache.maven.artifact.deployer.ArtifactDeploymentException - if deployment fails
      IOException - if reading of index fails
    • getArtifactRepositoryForDirectory

      protected org.apache.maven.artifact.repository.ArtifactRepository getArtifactRepositoryForDirectory(File stagingDirectory) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getDeploymentRepository

      protected org.apache.maven.artifact.repository.ArtifactRepository getDeploymentRepository(org.apache.maven.execution.MavenSession mavenSession, String centralSnapshotsUrl, String publishingServerId) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • createStagingArtifactRepository

      protected org.apache.maven.artifact.repository.ArtifactRepository createStagingArtifactRepository(String url)
    • createDeploymentArtifactRepository

      protected org.apache.maven.artifact.repository.ArtifactRepository createDeploymentArtifactRepository(String id, String url)