org.nuiton.wikitty.plugin
Class CopyDependencyUtil

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.AbstractDependencyFilterMojo
              extended by org.apache.maven.plugin.dependency.AbstractFromDependenciesMojo
                  extended by org.nuiton.wikitty.plugin.CopyDependencyUtil
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class CopyDependencyUtil
extends org.apache.maven.plugin.dependency.AbstractFromDependenciesMojo


Field Summary
protected  org.apache.maven.artifact.installer.ArtifactInstaller installer
           
protected  org.apache.maven.artifact.repository.ArtifactRepositoryFactory repositoryFactory
           
 
Fields inherited from class org.apache.maven.plugin.dependency.AbstractFromDependenciesMojo
copyPom, failOnMissingClassifierArtifact, outputDirectory, stripVersion, useRepositoryLayout, useSubDirectoryPerArtifact, useSubDirectoryPerScope, useSubDirectoryPerType
 
Fields inherited from class org.apache.maven.plugin.dependency.AbstractDependencyFilterMojo
classifier, excludeArtifactIds, excludeClassifiers, excludeGroupIds, excludeScope, excludeTransitive, excludeTypes, includeArtifactIds, includeClassifiers, includeGroupIds, includeScope, includeTypes, markersDirectory, overWriteIfNewer, overWriteReleases, overWriteSnapshots, prependGroupId, type
 
Fields inherited from class org.apache.maven.plugin.dependency.AbstractDependencyMojo
archiverManager, artifactCollector, artifactMetadataSource, factory, outputAbsoluteArtifactFilename, project, reactorProjects, remoteRepos, resolver, silent
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
CopyDependencyUtil()
           
 
Method Summary
protected  void copyArtifact(org.apache.maven.artifact.Artifact artifact, boolean removeVersion, boolean prependGroupId)
          Copies the Artifact after building the destination file name if overridden.
 void copyPoms(File destDir, Set artifacts, boolean removeVersion)
          Copy the pom files associated with the artifacts.
 void execute()
          Main entry into mojo.
 org.apache.maven.artifact.installer.ArtifactInstaller getInstaller()
           
protected  org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter getMarkedArtifactFilter()
           
 org.apache.maven.artifact.repository.ArtifactRepositoryFactory getRepositoryFactory()
           
 Map getRepositoryLayouts()
           
protected  org.apache.maven.artifact.Artifact getResolvedPomArtifact(org.apache.maven.artifact.Artifact artifact)
           
 void setInstaller(org.apache.maven.artifact.installer.ArtifactInstaller installer)
           
 void setProject(org.apache.maven.project.MavenProject pro)
           
 void setRepositoryFactory(org.apache.maven.artifact.repository.ArtifactRepositoryFactory repositoryFactory)
           
 void setRepositoryLayouts(Map repositoryLayouts)
           
 
Methods inherited from class org.apache.maven.plugin.dependency.AbstractFromDependenciesMojo
getOutputDirectory, isCopyPom, isFailOnMissingClassifierArtifact, isStripVersion, isUseRepositoryLayout, isUseSubDirectoryPerArtifact, isUseSubDirectoryPerScope, isUseSubDirectoryPerType, setCopyPom, setFailOnMissingClassifierArtifact, setOutputDirectory, setStripVersion, setUseRepositoryLayout, setUseSubDirectoryPerArtifact, setUseSubDirectoryPerScope, setUseSubDirectoryPerType
 
Methods inherited from class org.apache.maven.plugin.dependency.AbstractDependencyFilterMojo
filterMarkedDependencies, getClassifierTranslatedDependencies, getDependencySets, getMarkersDirectory, getResolvedDependencies, isPrependGroupId, setMarkersDirectory, setPrependGroupId
 
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
 

Field Detail

installer

protected org.apache.maven.artifact.installer.ArtifactInstaller installer
Is a Plexus component defined by:

repositoryFactory

protected org.apache.maven.artifact.repository.ArtifactRepositoryFactory repositoryFactory
Is a Plexus component defined by:
Constructor Detail

CopyDependencyUtil

public CopyDependencyUtil()
Method Detail

getInstaller

public org.apache.maven.artifact.installer.ArtifactInstaller getInstaller()

setInstaller

public void setInstaller(org.apache.maven.artifact.installer.ArtifactInstaller installer)

getRepositoryFactory

public org.apache.maven.artifact.repository.ArtifactRepositoryFactory getRepositoryFactory()

setRepositoryFactory

public void setRepositoryFactory(org.apache.maven.artifact.repository.ArtifactRepositoryFactory repositoryFactory)

getRepositoryLayouts

public Map getRepositoryLayouts()

setRepositoryLayouts

public void setRepositoryLayouts(Map repositoryLayouts)

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Main entry into mojo. Gets the list of dependencies and iterates through calling copyArtifact.

Throws:
org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.
See Also:
#getDependencies, #copyArtifact(Artifact, boolean)

copyArtifact

protected void copyArtifact(org.apache.maven.artifact.Artifact artifact,
                            boolean removeVersion,
                            boolean prependGroupId)
                     throws org.apache.maven.plugin.MojoExecutionException
Copies the Artifact after building the destination file name if overridden. This method also checks if the classifier is set and adds it to the destination file name if needed.

Parameters:
artifact - representing the object to be copied.
removeVersion - specifies if the version should be removed from the file name when copying.
prependGroupId - specifies if the groupId should be prepend to the file while 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)

copyPoms

public void copyPoms(File destDir,
                     Set artifacts,
                     boolean removeVersion)
              throws org.apache.maven.plugin.MojoExecutionException
Copy the pom files associated with the artifacts.

Throws:
org.apache.maven.plugin.MojoExecutionException

getResolvedPomArtifact

protected org.apache.maven.artifact.Artifact getResolvedPomArtifact(org.apache.maven.artifact.Artifact artifact)

getMarkedArtifactFilter

protected org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter getMarkedArtifactFilter()
Specified by:
getMarkedArtifactFilter in class org.apache.maven.plugin.dependency.AbstractDependencyFilterMojo

setProject

public void setProject(org.apache.maven.project.MavenProject pro)


Copyright © 2011 CodeLutin. All Rights Reserved.