@Mojo(name="artifacts",
defaultPhase=VERIFY,
requiresProject=true,
inheritByDefault=false,
threadSafe=true)
public class ArtifactsMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
algorithms
The list of checksum algorithms used.
|
protected boolean |
appendFilename
Append the artifact filename in the generated checksum file.
|
protected boolean |
attachChecksums
Should the checksums be attached as build artifacts.
|
protected boolean |
csvSummary
Indicates whether the build will store checksums to a single CSV summary file.
|
protected String |
csvSummaryFile
The name of the summary file created if the option is activated.
|
protected String |
encoding
Encoding to use for generated files.
|
protected boolean |
failOnError
Indicates whether the build will fail if there are errors.
|
protected boolean |
includeRelativePath
Indicates whether the build will output relative path information as well.
|
protected boolean |
individualFiles
Indicates whether the build will store checksums in separate files (one file per algorithm per artifact).
|
protected String |
individualFilesOutputDirectory
The directory where output files will be stored.
|
static String |
NAME
The mojo name.
|
protected org.apache.maven.project.MavenProject |
project
The Maven project.
|
protected org.apache.maven.project.MavenProjectHelper |
projectHelper
The Maven Project Helper.
|
protected boolean |
quiet
Indicates whether the build will print checksums in the build log.
|
protected String |
relativeSubPath
Sub path to use as the root of the relative path when including relative path in xml/csv files
|
protected boolean |
shasumSummary
Indicates whether the build will store checksums to a single shasum summary file.
|
protected String |
shasumSummaryFile
The name of the summary file created if the option is activated.
|
protected boolean |
xmlSummary
Indicates whether the build will store checksums to a single XML summary file.
|
protected String |
xmlSummaryFile
The name of the summary file created if the option is activated.
|
| Constructor and Description |
|---|
ArtifactsMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute() |
protected String |
getCsvSummaryFile() |
protected List<ChecksumFile> |
getFilesToProcess()
Build the list of files from which digests should be generated.
|
protected String |
getIndividualFilesOutputDirectory() |
protected String |
getShasumSummaryFile() |
protected String |
getXmlSummaryFile() |
protected boolean |
hasValidFile(org.apache.maven.artifact.Artifact artifact)
Decide whether the artifact file should be processed.
|
protected boolean |
isAppendFilename() |
protected boolean |
isCsvSummary() |
protected boolean |
isIndividualFiles() |
protected boolean |
isShasumSummary() |
protected boolean |
isXmlSummary() |
public static final String NAME
@Parameter(defaultValue="true") protected boolean individualFiles
@Parameter protected String individualFilesOutputDirectory
@Parameter(defaultValue="false") protected boolean csvSummary
@Parameter(defaultValue="artifacts-checksums.csv") protected String csvSummaryFile
csvSummary@Parameter(defaultValue="false") protected boolean xmlSummary
@Parameter(defaultValue="artifacts-checksums.xml") protected String xmlSummaryFile
xmlSummary@Parameter(defaultValue="false") protected boolean shasumSummary
@Parameter(defaultValue="artifacts-checksums.sha") protected String shasumSummaryFile
shasumSummary@Parameter(defaultValue="false") protected boolean appendFilename
individualFiles@Parameter(property="project",
required=true,
readonly=true)
protected org.apache.maven.project.MavenProject project
@Component protected org.apache.maven.project.MavenProjectHelper projectHelper
@Parameter protected List<String> algorithms
Default value is MD5 and SHA-1.
Allowed values are CRC32, MD2, MD4, MD5, SHA-1, SHA-224, SHA-256, SHA-384,
SHA-512, RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD320, GOST3411 and Tiger.
Use the following syntax:
<algorithms> <algorithm>MD5<algorithm> <algorithm>SHA-1<algorithm> </algorithms>
@Parameter(defaultValue="true") protected boolean failOnError
@Parameter(property="encoding",
defaultValue="${project.build.sourceEncoding}")
protected String encoding
@Parameter(property="attachChecksums",
defaultValue="false")
protected boolean attachChecksums
@Parameter(defaultValue="false") protected boolean quiet
@Parameter(defaultValue="false") protected boolean includeRelativePath
@Parameter(defaultValue="") protected String relativeSubPath
protected List<ChecksumFile> getFilesToProcess()
The list is composed of the project main and attached artifacts.
hasValidFile(org.apache.maven.artifact.Artifact)protected boolean hasValidFile(org.apache.maven.artifact.Artifact artifact)
Excludes the project POM file and any file outside the build directory, because this could lead to writing files on the user local repository for example.
artifact - the artifact to check.protected boolean isIndividualFiles()
protected String getIndividualFilesOutputDirectory()
protected boolean isAppendFilename()
protected boolean isCsvSummary()
protected String getCsvSummaryFile()
protected boolean isXmlSummary()
protected String getXmlSummaryFile()
protected boolean isShasumSummary()
protected String getShasumSummaryFile()
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionCopyright © 2010–2016. All rights reserved.