org.apache.maven.tools.plugin
Class DefaultPluginToolsRequest

java.lang.Object
  extended by org.apache.maven.tools.plugin.DefaultPluginToolsRequest
All Implemented Interfaces:
PluginToolsRequest

public class DefaultPluginToolsRequest
extends Object
implements PluginToolsRequest

Default implementation of PluginToolsRequest, which is used to pass parameters to components used to extract MojoDescriptor instances from different types of metadata for a given plugin.

Since:
2.5
Author:
jdcasey

Constructor Summary
DefaultPluginToolsRequest(org.apache.maven.project.MavenProject project, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
           
 
Method Summary
 Set<org.apache.maven.artifact.Artifact> getDependencies()
          Returns the list of Artifact used in class path scanning for annotations
 String getEncoding()
          Gets the file encoding of the source files.
 org.apache.maven.artifact.repository.ArtifactRepository getLocal()
           
 org.apache.maven.plugin.descriptor.PluginDescriptor getPluginDescriptor()
          Return the PluginDescriptor currently being populated as part of the build of the current plugin project.
 org.apache.maven.project.MavenProject getProject()
          Return the current MavenProject instance in use.
 List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepos()
           
 boolean isSkipErrorNoDescriptorsFound()
          
 PluginToolsRequest setDependencies(Set<org.apache.maven.artifact.Artifact> dependencies)
           
 PluginToolsRequest setEncoding(String encoding)
          Sets the file encoding of the source files.
 PluginToolsRequest setLocal(org.apache.maven.artifact.repository.ArtifactRepository local)
           
 PluginToolsRequest setPluginDescriptor(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
          
 PluginToolsRequest setProject(org.apache.maven.project.MavenProject project)
          
 PluginToolsRequest setRemoteRepos(List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos)
           
 PluginToolsRequest setSkipErrorNoDescriptorsFound(boolean skipErrorNoDescriptorsFound)
          By default an exception is throw if no mojo descriptor is found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPluginToolsRequest

public DefaultPluginToolsRequest(org.apache.maven.project.MavenProject project,
                                 org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
Method Detail

getPluginDescriptor

public org.apache.maven.plugin.descriptor.PluginDescriptor getPluginDescriptor()
Return the PluginDescriptor currently being populated as part of the build of the current plugin project.

Specified by:
getPluginDescriptor in interface PluginToolsRequest

setPluginDescriptor

public PluginToolsRequest setPluginDescriptor(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)

Specified by:
setPluginDescriptor in interface PluginToolsRequest
See Also:
PluginToolsRequest.getPluginDescriptor()

getProject

public org.apache.maven.project.MavenProject getProject()
Return the current MavenProject instance in use.

Specified by:
getProject in interface PluginToolsRequest

setProject

public PluginToolsRequest setProject(org.apache.maven.project.MavenProject project)

Specified by:
setProject in interface PluginToolsRequest
See Also:
PluginToolsRequest.getProject()

getEncoding

public String getEncoding()
Gets the file encoding of the source files.

Specified by:
getEncoding in interface PluginToolsRequest
Returns:
The file encoding of the source files, never null.

setEncoding

public PluginToolsRequest setEncoding(String encoding)
Sets the file encoding of the source files.

Specified by:
setEncoding in interface PluginToolsRequest
Parameters:
encoding - The file encoding of the source files, may be empty or null to use the platform's default encoding.
Returns:
This request.

isSkipErrorNoDescriptorsFound

public boolean isSkipErrorNoDescriptorsFound()

Specified by:
isSkipErrorNoDescriptorsFound in interface PluginToolsRequest
Returns:

setSkipErrorNoDescriptorsFound

public PluginToolsRequest setSkipErrorNoDescriptorsFound(boolean skipErrorNoDescriptorsFound)
By default an exception is throw if no mojo descriptor is found. As the maven-plugin is defined in core, the descriptor generator mojo is bound to generate-resources phase. But for annotations, the compiled classes are needed, so skip error

Specified by:
setSkipErrorNoDescriptorsFound in interface PluginToolsRequest

getDependencies

public Set<org.apache.maven.artifact.Artifact> getDependencies()
Description copied from interface: PluginToolsRequest
Returns the list of Artifact used in class path scanning for annotations

Specified by:
getDependencies in interface PluginToolsRequest
Returns:

setDependencies

public PluginToolsRequest setDependencies(Set<org.apache.maven.artifact.Artifact> dependencies)
Specified by:
setDependencies in interface PluginToolsRequest
Returns:

getRemoteRepos

public List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepos()
Specified by:
getRemoteRepos in interface PluginToolsRequest
Returns:

setRemoteRepos

public PluginToolsRequest setRemoteRepos(List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos)
Specified by:
setRemoteRepos in interface PluginToolsRequest
Returns:

getLocal

public org.apache.maven.artifact.repository.ArtifactRepository getLocal()
Specified by:
getLocal in interface PluginToolsRequest
Returns:

setLocal

public PluginToolsRequest setLocal(org.apache.maven.artifact.repository.ArtifactRepository local)
Specified by:
setLocal in interface PluginToolsRequest
Returns:


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.