org.apache.maven.plugin.dependency
Class BuildClasspathMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugin.dependency.AbstractDependencyMojo
org.apache.maven.plugin.dependency.AbstractDependencyFilterMojo
org.apache.maven.plugin.dependency.BuildClasspathMojo
- All Implemented Interfaces:
- Comparator<Artifact>, ContextEnabled, Mojo
@Mojo(name="build-classpath",
requiresDependencyResolution=TEST,
defaultPhase=GENERATE_SOURCES,
threadSafe=true)
public class BuildClasspathMojo
- extends AbstractDependencyFilterMojo
- implements Comparator<Artifact>
This goal will output a classpath string of dependencies from the local repository to a file or log.
- Since:
- 2.0-alpha-2
- Version:
- $Id: BuildClasspathMojo.java 1451088 2013-02-28 04:22:41Z brianf $
- Author:
- ankostis
Field Summary |
protected boolean |
useBaseVersion
Either append the artifact's baseVersion or uniqueVersion to the filename. |
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, ignorePermissions, outputAbsoluteArtifactFilename, project, reactorProjects, remoteRepos, resolver, silent, useJvmChmod |
Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
Methods inherited from class org.apache.maven.plugin.dependency.AbstractDependencyMojo |
copyFile, execute, getArchiverManager, getArtifactCollector, getArtifactMetadataSource, getFactory, getLocal, getLog, getProject, getRemoteRepos, getResolver, isSkip, isUseJvmChmod, setArchiverManager, setArtifactCollector, setArtifactMetadataSource, setFactory, setLocal, setRemoteRepos, setResolver, setSkip, setUseJvmChmod, unpack, unpack |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
useBaseVersion
@Parameter(property="mdep.useBaseVersion",
defaultValue="true")
protected boolean useBaseVersion
- Either append the artifact's baseVersion or uniqueVersion to the filename.
Will only be used if
isStripVersion()
is false
.
- Since:
- 2.6
BuildClasspathMojo
public BuildClasspathMojo()
doExecute
protected void doExecute()
throws MojoExecutionException
- Main entry into mojo. Gets the list of dependencies and iterates through calling copyArtifact.
- Specified by:
doExecute
in class AbstractDependencyMojo
- Throws:
MojoExecutionException
- with a message if an error occurs.- See Also:
#getDependencies
,
#copyArtifact(Artifact, boolean)
attachFile
protected void attachFile(String cpString)
throws MojoExecutionException
- Throws:
MojoExecutionException
appendArtifactPath
protected void appendArtifactPath(Artifact art,
StringBuilder sb)
- Appends the artifact path into the specified StringBuilder.
- Parameters:
art
- sb
-
readClasspathFile
protected String readClasspathFile()
throws IOException
- Reads into a string the file specified by the mojo param 'outputFile'. Assumes, the instance variable
'outputFile' is not null.
- Returns:
- the string contained in the classpathFile, if exists, or null otherwise.
- Throws:
MojoExecutionException
IOException
compare
public int compare(Artifact art1,
Artifact art2)
- Compares artifacts lexicographically, using pattern [group_id][artifact_id][version].
- Specified by:
compare
in interface Comparator<Artifact>
- Parameters:
art1
- first objectart2
- second object
- Returns:
- the value
0
if the argument string is equal to this string; a value less than
0
if this string is lexicographically less than the string argument; and a value greater
than 0
if this string is lexicographically greater than the string argument.
getMarkedArtifactFilter
protected ArtifactsFilter getMarkedArtifactFilter()
- Description copied from class:
AbstractDependencyFilterMojo
- Return an
ArtifactsFilter
indicating which artifacts must be filtered out.
- Specified by:
getMarkedArtifactFilter
in class AbstractDependencyFilterMojo
- Returns:
- an
ArtifactsFilter
indicating which artifacts must be filtered out.
getCpFile
public File getCpFile()
- Returns:
- the outputFile
setCpFile
public void setCpFile(File theCpFile)
- Parameters:
theCpFile
- the outputFile to set
getOutputProperty
public String getOutputProperty()
- Returns:
- the outputProperty
setOutputProperty
public void setOutputProperty(String theOutputProperty)
- Parameters:
theOutputProperty
- the outputProperty to set
getFileSeparator
public String getFileSeparator()
- Returns:
- the fileSeparator
setFileSeparator
public void setFileSeparator(String theFileSeparator)
- Parameters:
theFileSeparator
- the fileSeparator to set
getPathSeparator
public String getPathSeparator()
- Returns:
- the pathSeparator
setPathSeparator
public void setPathSeparator(String thePathSeparator)
- Parameters:
thePathSeparator
- the pathSeparator to set
getPrefix
public String getPrefix()
- Returns:
- the prefix
setPrefix
public void setPrefix(String thePrefix)
- Parameters:
thePrefix
- the prefix to set
isRegenerateFile
public boolean isRegenerateFile()
- Returns:
- the regenerateFile
setRegenerateFile
public void setRegenerateFile(boolean theRegenerateFile)
- Parameters:
theRegenerateFile
- the regenerateFile to set
isStripVersion
public boolean isStripVersion()
- Returns:
- the stripVersion
setStripVersion
public void setStripVersion(boolean theStripVersion)
- Parameters:
theStripVersion
- the stripVersion to set
getLocalRepoProperty
public String getLocalRepoProperty()
setLocalRepoProperty
public void setLocalRepoProperty(String localRepoProperty)
isFileSepSet
public boolean isFileSepSet()
setFileSepSet
public void setFileSepSet(boolean isFileSepSet)
isPathSepSet
public boolean isPathSepSet()
setPathSepSet
public void setPathSepSet(boolean isPathSepSet)
Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.