@Component(role=ProjectDeployer.class) class DefaultProjectDeployer extends java.lang.Object implements ProjectDeployer
Modifier and Type | Field and Description |
---|---|
private ArtifactDeployer |
deployer |
private DualDigester |
digester |
private static org.slf4j.Logger |
LOGGER |
private RepositoryManager |
repositoryManager |
Constructor and Description |
---|
DefaultProjectDeployer() |
Modifier and Type | Method and 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.util.Collection<java.io.File> metadataFiles)
Installs the checksums for the specified metadata files.
|
private void |
installChecksums(java.io.File installedFile)
Installs the checksums for the specified file (if it exists).
|
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) |
private static final org.slf4j.Logger LOGGER
@Requirement private ArtifactDeployer deployer
@Requirement private RepositoryManager repositoryManager
private final DualDigester digester
public void deploy(org.apache.maven.project.ProjectBuildingRequest buildingRequest, ProjectDeployerRequest projectDeployerRequest, org.apache.maven.artifact.repository.ArtifactRepository artifactRepository) throws NoFileAssignedException, java.lang.IllegalArgumentException, ArtifactDeployerException
@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);
deploy
in interface ProjectDeployer
buildingRequest
- ProjectBuildingRequest
projectDeployerRequest
- ProjectDeployerRequest
artifactRepository
- ArtifactRepository
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.private void validateParameters(org.apache.maven.project.ProjectBuildingRequest buildingRequest, ProjectDeployerRequest projectDeployerRequest, org.apache.maven.artifact.repository.ArtifactRepository artifactRepository)
private void installChecksumsForAllArtifacts(org.apache.maven.project.ProjectBuildingRequest request, java.util.Collection<org.apache.maven.artifact.Artifact> artifacts)
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
ArtifactDeployerException
private void installChecksums(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.artifact.Artifact artifact) throws java.io.IOException
buildingRequest
- The project building request, must not be null
.artifact
- The artifact for which to create checksums, must not be null
.java.io.IOException
- If the checksums could not be installed.private void installChecksums(java.util.Collection<java.io.File> metadataFiles) throws java.io.IOException
metadataFiles
- The collection of metadata files to install checksums for, must not be null
.java.io.IOException
- If the checksums could not be installed.private void installChecksums(java.io.File installedFile) throws java.io.IOException
installedFile
- The path to the already installed file in the local repo for which to generate checksums,
must not be null
.java.io.IOException
- In case of errors. Could not install checksums.private void installChecksum(java.io.File installedFile, java.lang.String ext, java.lang.String checksum) throws java.io.IOException
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 writejava.io.IOException
- If the checksum could not be installed.private java.io.File getLocalRepoFile(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.artifact.Artifact artifact)
buildingRequest
- The project building request, must not be null
.artifact
- The artifact whose local repo path should be determined, must not be null
.null
.private java.io.File getLocalRepoFile(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.artifact.metadata.ArtifactMetadata metadata)
buildingRequest
- The project building request, must not be null
.metadata
- The artifact metadata whose local repo path should be determined, must not be null
.null
.