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 SummaryFields inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojoreactorProjects, sessionFields inherited from interface org.apache.maven.plugin.MojoROLE
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractFromConfigurationMojo(org.apache.maven.execution.MavenSession session, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.project.MavenProject project, org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager, org.eclipse.aether.RepositorySystem repositorySystem) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected org.apache.maven.artifact.ArtifactgetArtifact(ArtifactItem artifactItem) Resolves the Artifact from the remote repository if necessary.protected List<ArtifactItem> getProcessedArtifactItems(ProcessArtifactItemsRequest processArtifactItemsRequest) Preprocesses the list of ArtifactItems.booleanbooleanbooleanvoidsetArtifact(String artifact) voidsetArtifactItems(List<ArtifactItem> theArtifactItems) voidsetLocalRepositoryDirectory(File localRepositoryDirectory) voidsetOutputDirectory(File theOutputDirectory) voidsetOverWriteIfNewer(boolean theOverWriteIfNewer) voidsetOverWriteReleases(boolean theOverWriteReleases) voidsetOverWriteSnapshots(boolean theOverWriteSnapshots) protected voidArtifactItems is filled by either field injection or by setArtifact().Methods inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojodoExecute, execute, getProject, isSilent, isSkip, setSilent, setSkipMethods inherited from class org.apache.maven.plugin.AbstractMojogetLog, getPluginContext, setLog, setPluginContext
- 
Constructor Details- 
AbstractFromConfigurationMojoprotected AbstractFromConfigurationMojo(org.apache.maven.execution.MavenSession session, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.project.MavenProject project, org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager, org.eclipse.aether.RepositorySystem repositorySystem) 
 
- 
- 
Method Details- 
verifyRequirementsprotected 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
 
- 
getProcessedArtifactItemsprotected 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:
 
- 
getArtifactprotected 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- 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
 
- 
isOverWriteIfNewerpublic boolean isOverWriteIfNewer()- Returns:
- returns the overWriteIfNewer
 
- 
setOverWriteIfNewerpublic void setOverWriteIfNewer(boolean theOverWriteIfNewer) - Parameters:
- theOverWriteIfNewer- the overWriteIfNewer to set
 
- 
isOverWriteReleasespublic boolean isOverWriteReleases()- Returns:
- returns the overWriteReleases
 
- 
setOverWriteReleasespublic void setOverWriteReleases(boolean theOverWriteReleases) - Parameters:
- theOverWriteReleases- the overWriteReleases to set
 
- 
isOverWriteSnapshotspublic boolean isOverWriteSnapshots()- Returns:
- returns the overWriteSnapshots
 
- 
setOverWriteSnapshotspublic 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
 
 
-