Class AbstractFromConfigurationMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.dependency.AbstractDependencyMojo
org.apache.maven.plugins.dependency.fromConfiguration.AbstractFromConfigurationMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CopyMojo
,UnpackMojo
Abstract parent class used by mojos that get Artifact information from the plugin configuration as an ArrayList of
ArtifactItems
- Author:
- Brian Fox
- See Also:
-
Field Summary
Fields inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
reactorProjects, session
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.maven.artifact.Artifact
getArtifact
(ArtifactItem artifactItem) Resolves the Artifact from the remote repository if necessary.protected List
<ArtifactItem> getProcessedArtifactItems
(ProcessArtifactItemsRequest processArtifactItemsRequest) Preprocesses the list of ArtifactItems.boolean
boolean
boolean
void
setArtifact
(String artifact) void
setArtifactItems
(List<ArtifactItem> theArtifactItems) void
setLocalRepositoryDirectory
(File localRepositoryDirectory) void
setOutputDirectory
(File theOutputDirectory) void
setOverWriteIfNewer
(boolean theOverWriteIfNewer) void
setOverWriteReleases
(boolean theOverWriteReleases) void
setOverWriteSnapshots
(boolean theOverWriteSnapshots) protected void
artifactItems is filled by either field injection or by setArtifact().Methods inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
doExecute, execute, getProject, isSilent, isSkip, newResolveArtifactProjectBuildingRequest, newResolvePluginProjectBuildingRequest, setSilent, setSkip
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
AbstractFromConfigurationMojo
public AbstractFromConfigurationMojo()
-
-
Method Details
-
verifyRequirements
protected void verifyRequirements() throws org.apache.maven.plugin.MojoFailureExceptionartifactItems is filled by either field injection or by setArtifact().- Throws:
org.apache.maven.plugin.MojoFailureException
- in case of an error.
-
getProcessedArtifactItems
protected List<ArtifactItem> getProcessedArtifactItems(ProcessArtifactItemsRequest processArtifactItemsRequest) throws org.apache.maven.plugin.MojoExecutionException Preprocesses the list of ArtifactItems. This method defaults the outputDirectory if not set and creates the output Directory if it doesn't exist.- Parameters:
processArtifactItemsRequest
- preprocessing instructions- Returns:
- An ArrayList of preprocessed ArtifactItems
- Throws:
org.apache.maven.plugin.MojoExecutionException
- with a message if an error occurs.- See Also:
-
getArtifact
protected org.apache.maven.artifact.Artifact getArtifact(ArtifactItem artifactItem) throws org.apache.maven.plugin.MojoExecutionException Resolves the Artifact from the remote repository if necessary. If no version is specified, it will be retrieved from the dependency list or from the DependencyManagement section of the pom.- Parameters:
artifactItem
- containing information about artifact from plugin configuration.- Returns:
- Artifact object representing the specified file.
- Throws:
org.apache.maven.plugin.MojoExecutionException
- with a message if the version can't be found in DependencyManagement.
-
getArtifactItems
- Returns:
- Returns the artifactItems.
-
setArtifactItems
- Parameters:
theArtifactItems
- The artifactItems to set.
-
getOutputDirectory
- Returns:
- Returns the outputDirectory.
-
setOutputDirectory
- Parameters:
theOutputDirectory
- The outputDirectory to set.
-
isOverWriteIfNewer
public boolean isOverWriteIfNewer()- Returns:
- Returns the overWriteIfNewer.
-
setOverWriteIfNewer
public void setOverWriteIfNewer(boolean theOverWriteIfNewer) - Parameters:
theOverWriteIfNewer
- The overWriteIfNewer to set.
-
isOverWriteReleases
public boolean isOverWriteReleases()- Returns:
- Returns the overWriteReleases.
-
setOverWriteReleases
public void setOverWriteReleases(boolean theOverWriteReleases) - Parameters:
theOverWriteReleases
- The overWriteReleases to set.
-
isOverWriteSnapshots
public boolean isOverWriteSnapshots()- Returns:
- Returns the overWriteSnapshots.
-
setOverWriteSnapshots
public void setOverWriteSnapshots(boolean theOverWriteSnapshots) - Parameters:
theOverWriteSnapshots
- The overWriteSnapshots to set.
-
setLocalRepositoryDirectory
- Parameters:
localRepositoryDirectory
-localRepositoryDirectory
-
setArtifact
- Parameters:
artifact
- The artifact.- Throws:
org.apache.maven.plugin.MojoFailureException
- in case of an error.
-