Package org.apache.maven.tools.plugin
Class DefaultPluginToolsRequest
java.lang.Object
org.apache.maven.tools.plugin.DefaultPluginToolsRequest
- All Implemented Interfaces:
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
ConstructorDescriptionDefaultPluginToolsRequest(org.apache.maven.project.MavenProject project, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
-
Method Summary
Modifier and TypeMethodDescriptionSet<org.apache.maven.artifact.Artifact>
Returns the list ofArtifact
used in class path scanning for annotationsGets the file encoding of the source files.org.apache.maven.artifact.repository.ArtifactRepository
getLocal()
org.apache.maven.plugin.descriptor.PluginDescriptor
org.apache.maven.project.MavenProject
List<org.apache.maven.artifact.repository.ArtifactRepository>
boolean
setDependencies(Set<org.apache.maven.artifact.Artifact> dependencies)
setEncoding(String encoding)
Sets the file encoding of the source files.setLocal(org.apache.maven.artifact.repository.ArtifactRepository local)
setPluginDescriptor(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
setProject(org.apache.maven.project.MavenProject project)
setRemoteRepos(List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos)
setSkipErrorNoDescriptorsFound(boolean skipErrorNoDescriptorsFound)
By default an exception is throw if no mojo descriptor is found.
-
Constructor Details
-
DefaultPluginToolsRequest
public DefaultPluginToolsRequest(org.apache.maven.project.MavenProject project, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
-
-
Method Details
-
getPluginDescriptor
- Specified by:
getPluginDescriptor
in interfacePluginToolsRequest
- Returns:
- Return the
PluginDescriptor
currently being populated as part of the build of the current plugin project.
-
setPluginDescriptor
public PluginToolsRequest setPluginDescriptor(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)- Specified by:
setPluginDescriptor
in interfacePluginToolsRequest
- Parameters:
pluginDescriptor
- thePluginDescriptor
- Returns:
- This request.
- See Also:
PluginToolsRequest.getPluginDescriptor()
-
getProject
- Specified by:
getProject
in interfacePluginToolsRequest
- Returns:
- Return the current
MavenProject
instance in use.
-
setProject
- Specified by:
setProject
in interfacePluginToolsRequest
- Parameters:
project
- the currentMavenProject
- Returns:
- This request.
- See Also:
PluginToolsRequest.getProject()
-
getEncoding
Gets the file encoding of the source files.- Specified by:
getEncoding
in interfacePluginToolsRequest
- Returns:
- The file encoding of the source files, never
null
.
-
setEncoding
Sets the file encoding of the source files.- Specified by:
setEncoding
in interfacePluginToolsRequest
- Parameters:
encoding
- The file encoding of the source files, may be empty ornull
to use the platform's default encoding.- Returns:
- This request.
-
isSkipErrorNoDescriptorsFound
- Specified by:
isSkipErrorNoDescriptorsFound
in interfacePluginToolsRequest
- Returns:
true
if no descriptor found should not cause a failure
-
setSkipErrorNoDescriptorsFound
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 interfacePluginToolsRequest
- Parameters:
skipErrorNoDescriptorsFound
-true
to skip errors because of not found descriptors- Returns:
- This request.
-
getDependencies
Description copied from interface:PluginToolsRequest
Returns the list ofArtifact
used in class path scanning for annotations- Specified by:
getDependencies
in interfacePluginToolsRequest
- Returns:
- the dependencies
-
setDependencies
- Specified by:
setDependencies
in interfacePluginToolsRequest
- Parameters:
dependencies
- the dependencies- Returns:
- This request.
-
getRemoteRepos
- Specified by:
getRemoteRepos
in interfacePluginToolsRequest
- Returns:
- the remote repositories
-
setRemoteRepos
public PluginToolsRequest setRemoteRepos(List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos)- Specified by:
setRemoteRepos
in interfacePluginToolsRequest
- Parameters:
remoteRepos
- the remote repositories- Returns:
- This request.
-
getLocal
- Specified by:
getLocal
in interfacePluginToolsRequest
- Returns:
- the local artifact repository
-
setLocal
- Specified by:
setLocal
in interfacePluginToolsRequest
- Parameters:
local
- the local repository- Returns:
- This request.
-