org.codehaus.gmaven.plugin
Class MojoSupport
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.gmaven.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 76 2009-12-05 12:04:30Z 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 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 Exception
- Throws:
Exception
getProjectClasspathElements
protected List getProjectClasspathElements()
throws org.apache.maven.artifact.DependencyResolutionRequiredException
- Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException
getUserClassspathElements
protected ArtifactItem[] getUserClassspathElements()
createClassPath
protected URL[] createClassPath()
throws Exception
- Throws:
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 necessary. 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 necessary. 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 transitively
- Returns:
- The resolved artifact; never null
- Throws:
org.apache.maven.plugin.MojoExecutionException
- Failed to resolve artifact
Copyright © 2006-2012 Codehaus. All Rights Reserved.