public abstract class AbstractExternalDependencyMojo
extends org.apache.maven.plugin.install.AbstractInstallMojo
| Modifier and Type | Field and Description |
|---|---|
protected org.codehaus.plexus.archiver.manager.ArchiverManager |
archiverManager
Maven ArchieverManager.
|
protected ArrayList<ArtifactItem> |
artifactItems
Collection of ArtifactItems to work on.
|
protected org.apache.maven.artifact.resolver.ArtifactResolver |
artifactResolver
Used to look up Artifacts in the remote repository.
|
protected boolean |
centralChecksumVerification
If this property is set to true, the downloaded file's checksum will be
verified with a query against Maven Central Repository to make sure the
artifact isn't already there.
|
protected boolean |
createChecksum
Flag that indicates whether to create checksums (MD5, SHA-1) or not.
|
protected boolean |
disableSSLValidation
Flag that indicates whether to disable Java's SSL certificate and host validation.
|
protected boolean |
force
Forces a download, maven install, maven deploy
|
protected String |
globalSettings
Path to global settings.xml
|
protected org.apache.maven.artifact.installer.ArtifactInstaller |
installer
Used to install Artifact in the local repository.
|
protected org.apache.maven.artifact.repository.ArtifactRepository |
localRepository
Maven local repository
|
protected String |
NEWLINE
Newline constant
|
protected org.apache.maven.project.MavenProject |
project
Maven project
|
protected List<org.apache.maven.artifact.repository.ArtifactRepository> |
remoteRepositories
List of Remote Repositories used by the resolver
|
protected org.apache.maven.repository.RepositorySystem |
repositorySystem
Used to look up Artifacts in the remote repository.
|
protected String |
stagingDirectory
Staging directory for external dependencies
|
protected String |
userSettings
Path to user settings.xml
|
protected org.apache.maven.artifact.manager.WagonManager |
wagonManager
Maven WagonManager
|
| Constructor and Description |
|---|
AbstractExternalDependencyMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.maven.artifact.Artifact |
createArtifact(ArtifactItem item)
Create Maven Artifact object from ArtifactItem configuration descriptor.
|
protected void |
downloadArtifact(ArtifactItem artifactItem,
org.apache.maven.artifact.Artifact artifact,
File artifactFile,
Map<URL,File> cachedDownloads)
Download an artifact.
|
void |
execute() |
protected org.apache.maven.model.Model |
generateModel(ArtifactItem artifact)
Generates a minimal model from the user-supplied artifact information.
|
protected File |
generatePomFile(ArtifactItem artifact)
Generates a (temporary) POM file from the plugin configuration.
|
protected String |
getExtension(URL downloadURL)
Gets the file extension.
|
protected File |
getFullyQualifiedArtifactFilePath(ArtifactItem artifactItem)
Resolves the file path and returns a file object instance for an artifact
item.
|
protected org.apache.maven.wagon.proxy.ProxyInfo |
getProxyInfo()
Looks up ProxyInfo from Maven settings.
|
org.apache.maven.settings.building.SettingsBuilder |
getSettingsBuilder()
Generates a default settings builder.
|
org.apache.maven.settings.building.SettingsBuildingRequest |
getSettingsBuildingRequest()
Generates a settings builder request from parameters.
|
protected void |
installArtifact(ArtifactItem artifactItem,
org.apache.maven.artifact.Artifact artifact,
File stagedArtifactFile)
Install an artifact into the local repository
|
protected boolean |
resolveArtifactItem(org.apache.maven.artifact.Artifact artifact)
resolve the artifact in local or remote repository
|
protected void |
verifyArtifact(ArtifactItem artifactItem,
File stagedArtifactFile)
Verify artifact.
|
protected void |
verifyArtifactItemChecksum(ArtifactItem artifactItem,
File targetFile)
Validate artifact configured checksum against specified file.
|
protected void |
verifyArtifactItemChecksumByCentralLookup(ArtifactItem artifactItem,
File targetFile)
Validate downloaded file artifact checksum does not match another
artifact's checksum that already exists in the central Maven repository.
|
protected void |
verifyArtifactItemExtractFileChecksum(ArtifactItem artifactItem,
File targetFile)
Validate artifact configured extracted file checksum against specified
file.
|
protected boolean |
verifyChecksum(File targetFile,
org.codehaus.plexus.digest.Digester digester,
String checksum)
Verifies a checksum for the specified file.
|
addMetaDataFilesForArtifact, getLocalRepoFile, getLocalRepoFile, installChecksums, installChecksumsprotected org.apache.maven.repository.RepositorySystem repositorySystem
protected ArrayList<ArtifactItem> artifactItems
protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
protected org.apache.maven.artifact.installer.ArtifactInstaller installer
protected List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
protected org.apache.maven.artifact.manager.WagonManager wagonManager
protected org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
protected org.apache.maven.project.MavenProject project
protected String userSettings
protected String globalSettings
protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
protected String stagingDirectory
protected boolean force
protected boolean centralChecksumVerification
protected boolean createChecksum
protected boolean disableSSLValidation
protected final String NEWLINE
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected org.apache.maven.artifact.Artifact createArtifact(ArtifactItem item)
item - the itemprotected File generatePomFile(ArtifactItem artifact) throws org.apache.maven.plugin.MojoExecutionException
artifact - the artifactnull.org.apache.maven.plugin.MojoExecutionException - If the POM file could not be generated.protected org.apache.maven.model.Model generateModel(ArtifactItem artifact)
artifact - the artifactnull.protected File getFullyQualifiedArtifactFilePath(ArtifactItem artifactItem)
artifactItem - the artifact itemprotected boolean verifyChecksum(File targetFile, org.codehaus.plexus.digest.Digester digester, String checksum) throws org.apache.maven.plugin.MojoExecutionException
targetFile - the path to the file from which the checksum is
verified, must not be null.digester - the checksum algorithm to use, must not be null.checksum - the checksum to verify.org.apache.maven.plugin.MojoExecutionException - If the checksum could not be installed.protected void verifyArtifactItemChecksum(ArtifactItem artifactItem, File targetFile) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
artifactItem - to validate checksum againsttargetFile - to validate checksum againstorg.apache.maven.plugin.MojoExecutionException - the mojo execution exceptionorg.apache.maven.plugin.MojoFailureException - the mojo failure exceptionprotected void verifyArtifactItemExtractFileChecksum(ArtifactItem artifactItem, File targetFile) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
artifactItem - to validate checksum againsttargetFile - to validate checksum againstorg.apache.maven.plugin.MojoExecutionException - MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException - MojoFailureExceptionprotected void verifyArtifactItemChecksumByCentralLookup(ArtifactItem artifactItem, File targetFile) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
artifactItem - to validate checksum againsttargetFile - to validate checksum againstorg.apache.maven.plugin.MojoExecutionException - MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException - MojoFailureExceptionpublic org.apache.maven.settings.building.SettingsBuilder getSettingsBuilder()
public org.apache.maven.settings.building.SettingsBuildingRequest getSettingsBuildingRequest()
protected boolean resolveArtifactItem(org.apache.maven.artifact.Artifact artifact)
artifact - the artifact to resolveprotected void downloadArtifact(ArtifactItem artifactItem, org.apache.maven.artifact.Artifact artifact, File artifactFile, Map<URL,File> cachedDownloads) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
artifactItem - the artifact itemartifact - the artifactartifactFile - the artifact filecachedDownloads - the cached downloadsorg.apache.maven.plugin.MojoExecutionException - the mojo execution exceptionorg.apache.maven.plugin.MojoFailureException - the mojo failure exceptionprotected String getExtension(URL downloadURL)
downloadURL - the download urlprotected org.apache.maven.wagon.proxy.ProxyInfo getProxyInfo()
protected void verifyArtifact(ArtifactItem artifactItem, File stagedArtifactFile) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
artifactItem - the artifact itemstagedArtifactFile - the staged artifact fileorg.apache.maven.plugin.MojoExecutionException - the mojo execution exceptionorg.apache.maven.plugin.MojoFailureException - the mojo failure exceptionprotected void installArtifact(ArtifactItem artifactItem, org.apache.maven.artifact.Artifact artifact, File stagedArtifactFile) throws org.apache.maven.plugin.MojoExecutionException
artifactItem - the current ArtifactItemartifact - the Artifact representing the ArtifactItemstagedArtifactFile - the File representing the staged
location for the ArtifactItemorg.apache.maven.plugin.MojoExecutionException - MojoExecutionExceptionCopyright © 2015–2020. All rights reserved.