org.apache.maven.plugin.dependency.fromConfiguration
Class AbstractFromConfigurationMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.dependency.AbstractDependencyMojo
          extended by org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.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 1143035 2011-07-05 12:54:20Z stephenc $
Author:
Brian Fox
See Also:
ArtifactItem

Field Summary
protected  List<org.apache.maven.project.MavenProject> reactorProjects
          To search for artifacts within the reactor and ensure consistent behaviour between Maven 2 and Maven 3.
 
Fields inherited from class org.apache.maven.plugin.dependency.AbstractDependencyMojo
archiverManager, artifactCollector, artifactMetadataSource, factory, outputAbsoluteArtifactFilename, project, remoteRepos, resolver, silent
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractFromConfigurationMojo()
           
 
Method Summary
protected  org.apache.maven.artifact.Artifact getArtifact(ArtifactItem artifactItem)
          Resolves the Artifact from the remote repository if necessary.
 List<ArtifactItem> getArtifactItems()
           
protected  org.apache.maven.artifact.repository.ArtifactRepository getLocal()
          Override the base to
 File getOutputDirectory()
           
protected  List<ArtifactItem> getProcessedArtifactItems(boolean removeVersion)
          Preprocesses the list of ArtifactItems.
 boolean isOverWriteIfNewer()
           
 boolean isOverWriteReleases()
           
 boolean isOverWriteSnapshots()
           
 boolean isSkip()
           
 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)
           
 void setSkip(boolean skip)
           
 
Methods inherited from class org.apache.maven.plugin.dependency.AbstractDependencyMojo
copyFile, getArchiverManager, getArtifactCollector, getArtifactMetadataSource, getFactory, getLog, getProject, getRemoteRepos, getResolver, setArchiverManager, setArtifactCollector, setArtifactMetadataSource, setFactory, setLocal, setRemoteRepos, setResolver, unpack, unpack
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getPluginContext, setLog, setPluginContext
 
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
 

Field Detail

reactorProjects

protected List<org.apache.maven.project.MavenProject> reactorProjects
To search for artifacts within the reactor and ensure consistent behaviour between Maven 2 and Maven 3.

Is defined by:
expression:
${reactorProjects}
Is readonly.
Is required.
Constructor Detail

AbstractFromConfigurationMojo

public AbstractFromConfigurationMojo()
Method Detail

getProcessedArtifactItems

protected List<ArtifactItem> getProcessedArtifactItems(boolean removeVersion)
                                                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:
removeVersion - remove the version from the filename.
Returns:
An ArrayList of preprocessed ArtifactItems
Throws:
org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.
See Also:
ArtifactItem

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.

getLocal

protected org.apache.maven.artifact.repository.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)


Copyright © 2002-2011 The Apache Software Foundation. All Rights Reserved.