@Mojo(name="detach-distributions",
defaultPhase=VERIFY,
threadSafe=true,
aggregator=true)
public class CommonsDistributionDetachmentMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
private static Set<String> |
ARTIFACT_TYPES_TO_DETACH
A list of "artifact types" in the Maven vernacular, to
be detached from the deployment.
|
private org.apache.commons.collections4.properties.SortedProperties |
artifactSha512s
A
SortedProperties of Artifact → String containing the sha512 signatures
for the individual artifacts, where the Artifact is represented as:
groupId:artifactId:version:type=sha512. |
private List<org.apache.maven.artifact.Artifact> |
detachedArtifacts
This list is supposed to hold the Maven references to the aforementioned artifacts so that we
can upload them to svn after they've been detached from the Maven deployment.
|
private String |
distSvnStagingUrl
The subversion staging url to which we upload all of our staged artifacts.
|
private Boolean |
isDistModule
A parameter to generally avoid running unless it is specifically turned on by the consuming module.
|
private org.apache.maven.project.MavenProject |
project
The maven project context injection so that we can get a hold of the variables at hand.
|
private File |
workingDirectory
The working directory in
target that we use as a sandbox for the plugin. |
| Constructor and Description |
|---|
CommonsDistributionDetachmentMojo() |
| Modifier and Type | Method and Description |
|---|---|
private void |
copyRemovedArtifactsToWorkingDirectory()
A helper method to copy the newly detached artifacts to
target/commons-release-plugin
so that the CommonsDistributionStagingMojo can find the artifacts later. |
void |
execute() |
private String |
getArtifactKey(org.apache.maven.artifact.Artifact artifact)
Generates the unique artifact key for storage in our sha512 map.
|
private String |
getSha512FilePath(File directory,
File file)
A helper method to create a file path for the
sha512 signature file from a given file. |
private void |
hashArtifacts()
A helper method that creates sha512 signature files for our detached artifacts in the
target/commons-release-plugin directory for the purpose of being uploaded by
the CommonsDistributionStagingMojo. |
private void |
putAttachedArtifactInSha512Map(org.apache.maven.artifact.Artifact artifact)
Takes an attached artifact and puts the signature in the map.
|
private void |
writeAllArtifactsInSha512PropertiesFile()
Writes to ./target/commons-release-plugin/sha512.properties the artifact sha512's.
|
private static final Set<String> ARTIFACT_TYPES_TO_DETACH
private final List<org.apache.maven.artifact.Artifact> detachedArtifacts
private final org.apache.commons.collections4.properties.SortedProperties artifactSha512s
SortedProperties of Artifact → String containing the sha512 signatures
for the individual artifacts, where the Artifact is represented as:
groupId:artifactId:version:type=sha512.@Parameter(defaultValue="${project}",
required=true)
private org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${project.build.directory}/commons-release-plugin",
property="commons.outputDirectory")
private File workingDirectory
target that we use as a sandbox for the plugin.@Parameter(defaultValue="",
property="commons.distSvnStagingUrl")
private String distSvnStagingUrl
@Parameter(defaultValue="false",
property="commons.release.isDistModule")
private Boolean isDistModule
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate void putAttachedArtifactInSha512Map(org.apache.maven.artifact.Artifact artifact)
throws org.apache.maven.plugin.MojoExecutionException
artifact - is a Maven Artifact taken from the project at start time of mojo.org.apache.maven.plugin.MojoExecutionException - if an IOException occurs when getting the sha512 of the
artifact.private void writeAllArtifactsInSha512PropertiesFile()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - if we can't write the file due to an IOException.private void copyRemovedArtifactsToWorkingDirectory()
throws org.apache.maven.plugin.MojoExecutionException
target/commons-release-plugin
so that the CommonsDistributionStagingMojo can find the artifacts later.org.apache.maven.plugin.MojoExecutionException - if some form of an IOException occurs, we want it
properly wrapped so that Maven can handle it.private void hashArtifacts()
throws org.apache.maven.plugin.MojoExecutionException
target/commons-release-plugin directory for the purpose of being uploaded by
the CommonsDistributionStagingMojo.org.apache.maven.plugin.MojoExecutionException - if some form of an IOException occurs, we want it
properly wrapped so that Maven can handle it.private String getSha512FilePath(File directory, File file)
sha512 signature file from a given file.private String getArtifactKey(org.apache.maven.artifact.Artifact artifact)
artifact - the Artifact that we wish to generate a key for.Copyright © 2018–2022 The Apache Software Foundation. All rights reserved.