Class DefaultProjectDeployer

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void deploy​(org.apache.maven.project.ProjectBuildingRequest request, java.util.Collection<org.apache.maven.artifact.Artifact> artifacts, org.apache.maven.artifact.repository.ArtifactRepository deploymentRepository, int retryFailedDeploymentCount)  
      void deploy​(org.apache.maven.project.ProjectBuildingRequest buildingRequest, ProjectDeployerRequest projectDeployerRequest, org.apache.maven.artifact.repository.ArtifactRepository artifactRepository)
      This will deploy a single project which may contain several artifacts.
      private java.io.File getLocalRepoFile​(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.artifact.Artifact artifact)
      Gets the path of the specified artifact within the local repository.
      private java.io.File getLocalRepoFile​(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.artifact.metadata.ArtifactMetadata metadata)
      Gets the path of the specified artifact metadata within the local repository.
      private void installChecksum​(java.io.File installedFile, java.lang.String ext, java.lang.String checksum)
      Installs a checksum for the specified file.
      private void installChecksums​(java.io.File installedFile)
      Installs the checksums for the specified file (if it exists).
      private void installChecksums​(java.util.Collection<java.io.File> metadataFiles)
      Installs the checksums for the specified metadata files.
      private void installChecksums​(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.artifact.Artifact artifact)  
      private void installChecksumsForAllArtifacts​(org.apache.maven.project.ProjectBuildingRequest request, java.util.Collection<org.apache.maven.artifact.Artifact> artifacts)  
      private void validateParameters​(org.apache.maven.project.ProjectBuildingRequest buildingRequest, ProjectDeployerRequest projectDeployerRequest, org.apache.maven.artifact.repository.ArtifactRepository artifactRepository)  
      • Methods inherited from class java.lang.Object

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

      • DefaultProjectDeployer

        DefaultProjectDeployer()
    • Method Detail

      • deploy

        public void deploy​(org.apache.maven.project.ProjectBuildingRequest buildingRequest,
                           ProjectDeployerRequest projectDeployerRequest,
                           org.apache.maven.artifact.repository.ArtifactRepository artifactRepository)
                    throws NoFileAssignedException,
                           java.lang.IllegalArgumentException,
                           ArtifactDeployerException
        This will deploy a single project which may contain several artifacts. Those artifacts will be deployed into the appropriate remote repository.
          @Parameter( defaultValue = "${session}", required=true, readonly = true)
          MavenSession session;
          @Parameter( defaultValue = "${project}", required=true, readonly = true)
          MavenProject project;
          ..
          @Component
          ProjectDeployer deployer;
          
          ProjectDeployerRequest pdr = 
              new ProjectDeployerRequest()
                .setProject (project);
          
          deployer.deploy (session.getProjectBuildingRequest(), pdr, artifactRepository);
         
        Specified by:
        deploy in interface ProjectDeployer
        Parameters:
        buildingRequest - ProjectBuildingRequest
        projectDeployerRequest - ProjectDeployerRequest
        artifactRepository - ArtifactRepository
        Throws:
        NoFileAssignedException - In case of missing file which has not been assigned to project.
        java.lang.IllegalArgumentException - in case buildingRequest is null, request is null or artifactRepository is null.
        ArtifactDeployerException - in case of artifact could not correctly deployed.
      • validateParameters

        private void validateParameters​(org.apache.maven.project.ProjectBuildingRequest buildingRequest,
                                        ProjectDeployerRequest projectDeployerRequest,
                                        org.apache.maven.artifact.repository.ArtifactRepository artifactRepository)
      • installChecksumsForAllArtifacts

        private void installChecksumsForAllArtifacts​(org.apache.maven.project.ProjectBuildingRequest request,
                                                     java.util.Collection<org.apache.maven.artifact.Artifact> artifacts)
      • deploy

        private void deploy​(org.apache.maven.project.ProjectBuildingRequest request,
                            java.util.Collection<org.apache.maven.artifact.Artifact> artifacts,
                            org.apache.maven.artifact.repository.ArtifactRepository deploymentRepository,
                            int retryFailedDeploymentCount)
                     throws ArtifactDeployerException
        Throws:
        ArtifactDeployerException
      • installChecksums

        private void installChecksums​(org.apache.maven.project.ProjectBuildingRequest buildingRequest,
                                      org.apache.maven.artifact.Artifact artifact)
                               throws java.io.IOException
        Parameters:
        buildingRequest - The project building request, must not be null.
        artifact - The artifact for which to create checksums, must not be null.
        Throws:
        java.io.IOException - If the checksums could not be installed.
      • installChecksums

        private void installChecksums​(java.util.Collection<java.io.File> metadataFiles)
                               throws java.io.IOException
        Installs the checksums for the specified metadata files.
        Parameters:
        metadataFiles - The collection of metadata files to install checksums for, must not be null.
        Throws:
        java.io.IOException - If the checksums could not be installed.
      • installChecksums

        private void installChecksums​(java.io.File installedFile)
                               throws java.io.IOException
        Installs the checksums for the specified file (if it exists).
        Parameters:
        installedFile - The path to the already installed file in the local repo for which to generate checksums, must not be null.
        Throws:
        java.io.IOException - In case of errors. Could not install checksums.
      • installChecksum

        private void installChecksum​(java.io.File installedFile,
                                     java.lang.String ext,
                                     java.lang.String checksum)
                              throws java.io.IOException
        Installs a checksum for the specified file.
        Parameters:
        installedFile - The base path from which the path to the checksum files is derived by appending the given file extension, must not be null.
        ext - The file extension (including the leading dot) to use for the checksum file, must not be null.
        checksum - the checksum to write
        Throws:
        java.io.IOException - If the checksum could not be installed.
      • getLocalRepoFile

        private java.io.File getLocalRepoFile​(org.apache.maven.project.ProjectBuildingRequest buildingRequest,
                                              org.apache.maven.artifact.Artifact artifact)
        Gets the path of the specified artifact within the local repository. Note that the returned path need not exist (yet).
        Parameters:
        buildingRequest - The project building request, must not be null.
        artifact - The artifact whose local repo path should be determined, must not be null.
        Returns:
        The absolute path to the artifact when installed, never null.
      • getLocalRepoFile

        private java.io.File getLocalRepoFile​(org.apache.maven.project.ProjectBuildingRequest buildingRequest,
                                              org.apache.maven.artifact.metadata.ArtifactMetadata metadata)
        Gets the path of the specified artifact metadata within the local repository. Note that the returned path need not exist (yet).
        Parameters:
        buildingRequest - The project building request, must not be null.
        metadata - The artifact metadata whose local repo path should be determined, must not be null.
        Returns:
        The absolute path to the artifact metadata when installed, never null.