org.codehaus.mojo.dependency
Class CopyMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.dependency.AbstractFromConfigurationMojo
          extended by org.codehaus.mojo.dependency.CopyMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class CopyMojo
extends AbstractFromConfigurationMojo

Goal that copies a list of artifacts from the repository to defined locations.

Author:
brianf

Field Summary
 
Fields inherited from class org.codehaus.mojo.dependency.AbstractFromConfigurationMojo
archiverManager, project
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
CopyMojo()
           
 
Method Summary
protected  void copyArtifact(ArtifactItem artifactItem, boolean removeVersion)
          Resolves the artifact from the repository and copies it to the specified location.
 void execute()
          Main entry into mojo.
 
Methods inherited from class org.codehaus.mojo.dependency.AbstractFromConfigurationMojo
getArtifact, getArtifactItems
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyMojo

public CopyMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Main entry into mojo. This method gets the ArtifactItems and iterates through each one passing it to copyArtifact.

Throws:
org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.
See Also:
ArtifactItem, AbstractFromConfigurationMojo.getArtifactItems(), #copyArtifact(ArtifactItem)

copyArtifact

protected void copyArtifact(ArtifactItem artifactItem,
                            boolean removeVersion)
                     throws org.apache.maven.plugin.MojoExecutionException
Resolves the artifact from the repository and copies it to the specified location.

Parameters:
artifactItem - containing the information about the Artifact to copy.
removeVersion - specifies if the version should be removed from the file name when copying.
Throws:
org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.
See Also:
DependencyUtil.copyFile(File, File, Log), DependencyUtil.getFormattedFileName(Artifact, boolean)


Copyright © {inceptionYear}-2008 null. All Rights Reserved.