Class DefaultProjectDeployer
- java.lang.Object
-
- org.apache.maven.shared.transfer.project.deploy.internal.DefaultProjectDeployer
-
- All Implemented Interfaces:
ProjectDeployer
@Component(role=ProjectDeployer.class) class DefaultProjectDeployer extends java.lang.Object implements ProjectDeployer
This will deploy a whole project into the appropriate remote repository.
-
-
Field Summary
Fields Modifier and Type Field Description private ArtifactDeployer
deployer
private DualDigester
digester
private static org.slf4j.Logger
LOGGER
private RepositoryManager
repositoryManager
-
Constructor Summary
Constructors Constructor Description 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)
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
deployer
@Requirement private ArtifactDeployer deployer
-
repositoryManager
@Requirement private RepositoryManager repositoryManager
-
digester
private final DualDigester digester
-
-
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 interfaceProjectDeployer
- 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 casebuildingRequest
isnull
,request
isnull
orartifactRepository
isnull
.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 benull
.artifact
- The artifact for which to create checksums, must not benull
.- 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 benull
.- 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 benull
.- 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 benull
.ext
- The file extension (including the leading dot) to use for the checksum file, must not benull
.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 benull
.artifact
- The artifact whose local repo path should be determined, must not benull
.- 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 benull
.metadata
- The artifact metadata whose local repo path should be determined, must not benull
.- Returns:
- The absolute path to the artifact metadata when installed, never
null
.
-
-