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
ConstructorsConstructorDescriptionDefaultPluginToolsRequest(MavenProject project, PluginDescriptor pluginDescriptor)
-
Method Summary
Modifier and TypeMethodDescriptionReturns the list ofArtifact
used in class path scanning for annotationsGets the file encoding of the source files.getLocal()
boolean
setDependencies(Set<Artifact> dependencies)
setEncoding(String encoding)
Sets the file encoding of the source files.setLocal(ArtifactRepository local)
setPluginDescriptor(PluginDescriptor pluginDescriptor)
setProject(MavenProject project)
setRemoteRepos(List<ArtifactRepository> remoteRepos)
setSkipErrorNoDescriptorsFound(boolean skipErrorNoDescriptorsFound)
By default an exception is throw if no mojo descriptor is found.
-
Constructor Details
-
DefaultPluginToolsRequest
-
-
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
- 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
public boolean 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
- 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.
-