org.codehaus.groovy.maven.plugin
Class MojoSupport
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.groovy.maven.plugin.MojoSupport
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
- ProviderMojoSupport
public abstract class MojoSupport
- extends org.apache.maven.plugin.AbstractMojo
Support for Mojo implementations.
- Version:
- $Id: MojoSupport.java 13181 2008-08-10 14:05:55Z user57 $
- Author:
- Jason Dillon
Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
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 |
log
protected final org.slf4j.Logger log
project
protected org.apache.maven.project.MavenProject project
artifactFactory
protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
artifactResolver
protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
artifactMetadataSource
protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
artifactRepository
protected org.apache.maven.artifact.repository.ArtifactRepository artifactRepository
remoteRepositories
protected java.util.List remoteRepositories
MojoSupport
public MojoSupport()
execute
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
- Main Mojo execution hook. Sub-class should use
doExecute()
instead.
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
doExecute
protected abstract void doExecute()
throws java.lang.Exception
- Throws:
java.lang.Exception
getProjectClasspathElements
protected java.util.List getProjectClasspathElements()
throws org.apache.maven.artifact.DependencyResolutionRequiredException
- Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException
getUserClassspathElements
protected ArtifactItem[] getUserClassspathElements()
createClassPath
protected java.net.URL[] createClassPath()
throws java.lang.Exception
- Throws:
java.lang.Exception
createArtifact
protected org.apache.maven.artifact.Artifact createArtifact(ArtifactItem item)
throws org.apache.maven.plugin.MojoExecutionException
- Create a new artifact. If no version is specified, it will be retrieved from the dependency
list or from the DependencyManagement section of the pom.
- Parameters:
item
- The item to create an artifact for
- Returns:
- An unresolved artifact for the given item.
- Throws:
org.apache.maven.plugin.MojoExecutionException
- Failed to create artifact
getArtifact
protected org.apache.maven.artifact.Artifact getArtifact(ArtifactItem item)
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:
item
- The item to create an artifact for; must not be null
- Returns:
- The artifact for the given item
- Throws:
org.apache.maven.plugin.MojoExecutionException
- Failed to create artifact
resolveArtifact
protected org.apache.maven.artifact.Artifact resolveArtifact(org.apache.maven.artifact.Artifact artifact,
boolean transitive)
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:
artifact
- The artifact to be resolved; must not be nulltransitive
- True to resolve the artifact transitivly
- Returns:
- The resolved artifact; never null
- Throws:
org.apache.maven.plugin.MojoExecutionException
- Failed to resolve artifact
Copyright © 2006-2011 Codehaus. All Rights Reserved.