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 728546 2008-12-21 22:56:51Z bentmann $
Author:
Brian Fox
See Also:
ArtifactItem

Field Summary
 
Fields inherited from class org.apache.maven.plugin.dependency.AbstractDependencyMojo
archiverManager, artifactCollector, artifactMetadataSource, factory, local, outputAbsoluteArtifactFilename, project, reactorProjects, 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 nessessary.
 java.util.ArrayList getArtifactItems()
           
 java.io.File getOutputDirectory()
           
protected  java.util.ArrayList getProcessedArtifactItems(boolean removeVersion)
          Preprocesses the list of ArtifactItems.
 boolean isOverWriteIfNewer()
           
 boolean isOverWriteReleases()
           
 boolean isOverWriteSnapshots()
           
 void setArtifactItems(java.util.ArrayList theArtifactItems)
           
 void setOutputDirectory(java.io.File theOutputDirectory)
           
 void setOverWriteIfNewer(boolean theOverWriteIfNewer)
           
 void setOverWriteReleases(boolean theOverWriteReleases)
           
 void setOverWriteSnapshots(boolean theOverWriteSnapshots)
           
 
Methods inherited from class org.apache.maven.plugin.dependency.AbstractDependencyMojo
copyFile, getArchiverManager, getArtifactCollector, getArtifactMetadataSource, getFactory, getLocal, 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
 

Constructor Detail

AbstractFromConfigurationMojo

public AbstractFromConfigurationMojo()
Method Detail

getProcessedArtifactItems

protected java.util.ArrayList 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 nessessary. 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

public java.util.ArrayList getArtifactItems()
Returns:
Returns the artifactItems.

setArtifactItems

public void setArtifactItems(java.util.ArrayList theArtifactItems)
Parameters:
theArtifactItems - The artifactItems to set.

getOutputDirectory

public java.io.File getOutputDirectory()
Returns:
Returns the outputDirectory.

setOutputDirectory

public void setOutputDirectory(java.io.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.


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