org.apache.maven.plugin.dependency.fromConfiguration
Class AbstractFromConfigurationMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugin.dependency.AbstractDependencyMojo
org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo
- All Implemented Interfaces:
- ContextEnabled, Mojo
- Direct Known Subclasses:
- CopyMojo, UnpackMojo
public abstract class AbstractFromConfigurationMojo
- extends AbstractDependencyMojo
Abstract parent class used by mojos that get Artifact information from the plugin configuration as an ArrayList of
ArtifactItems
- Version:
- $Id: AbstractFromConfigurationMojo.java 1397671 2012-10-12 18:28:52Z rfscholte $
- Author:
- Brian Fox
- See Also:
ArtifactItem
Field Summary |
protected List<MavenProject> |
reactorProjects
To search for artifacts within the reactor and ensure consistent behaviour between Maven 2 and Maven 3. |
Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
Methods inherited from class org.apache.maven.plugin.dependency.AbstractDependencyMojo |
copyFile, getArchiverManager, getArtifactCollector, getArtifactMetadataSource, getFactory, getLog, getProject, getRemoteRepos, getResolver, isUseJvmChmod, setArchiverManager, setArtifactCollector, setArtifactMetadataSource, setFactory, setLocal, setRemoteRepos, setResolver, setUseJvmChmod, unpack, unpack |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.maven.plugin.Mojo |
execute |
reactorProjects
@Parameter(defaultValue="${reactorProjects}",
readonly=true,
required=true)
protected List<MavenProject> reactorProjects
- To search for artifacts within the reactor and ensure consistent behaviour between Maven 2 and Maven 3.
AbstractFromConfigurationMojo
public AbstractFromConfigurationMojo()
verifyRequirements
protected void verifyRequirements()
throws MojoFailureException
- Throws:
MojoFailureException
getProcessedArtifactItems
protected List<ArtifactItem> getProcessedArtifactItems(boolean removeVersion)
throws 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:
removeVersion
- remove the version from the filename.
- Returns:
- An ArrayList of preprocessed ArtifactItems
- Throws:
MojoExecutionException
- with a message if an error occurs.- See Also:
ArtifactItem
getArtifact
protected Artifact getArtifact(ArtifactItem artifactItem)
throws 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:
MojoExecutionException
- with a message if the version can't be found in DependencyManagement.
getLocal
protected ArtifactRepository getLocal()
- Override the base to
- Overrides:
getLocal
in class AbstractDependencyMojo
- Returns:
- Returns the local.
getArtifactItems
public List<ArtifactItem> getArtifactItems()
- Returns:
- Returns the artifactItems.
setArtifactItems
public void setArtifactItems(List<ArtifactItem> theArtifactItems)
- Parameters:
theArtifactItems
- The artifactItems to set.
getOutputDirectory
public File getOutputDirectory()
- Returns:
- Returns the outputDirectory.
setOutputDirectory
public void setOutputDirectory(File theOutputDirectory)
- 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
public void setLocalRepositoryDirectory(File localRepositoryDirectory)
isSkip
public boolean isSkip()
setSkip
public void setSkip(boolean skip)
setArtifact
public void setArtifact(String artifact)
throws MojoFailureException
- Throws:
MojoFailureException
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.