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.plugin.descriptor.PluginDescriptor
org.apache.maven.project.MavenProject
org.eclipse.aether.RepositorySystemSession
Return a Repository Sessionorg.apache.maven.settings.Settings
boolean
setDependencies
(Set<org.apache.maven.artifact.Artifact> dependencies) setEncoding
(String encoding) Sets the file encoding of the source files.setExternalJavadocBaseUrls
(List<URI> javadocLinks) setInternalJavadocBaseUrl
(URI baseUrl) setInternalJavadocVersion
(String javadocVersion) setPluginDescriptor
(org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor) setProject
(org.apache.maven.project.MavenProject project) void
setRepoSession
(org.eclipse.aether.RepositorySystemSession repoSession) Set a Repository SessionsetRequiredJavaVersion
(String requiredJavaVersion) setSettings
(org.apache.maven.settings.Settings settings) setSkipErrorNoDescriptorsFound
(boolean skipErrorNoDescriptorsFound) By default an exception is throw if no mojo descriptor is found.setUsedMavenApiVersion
(String mavenApiVersion)
-
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:
-
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:
-
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.
-
getRepoSession
Description copied from interface:PluginToolsRequest
Return a Repository Session- Specified by:
getRepoSession
in interfacePluginToolsRequest
- Returns:
- a Repository Session
-
setRepoSession
Description copied from interface:PluginToolsRequest
Set a Repository Session- Specified by:
setRepoSession
in interfacePluginToolsRequest
- Parameters:
repoSession
- a Repository Session
-
setInternalJavadocBaseUrl
- Specified by:
setInternalJavadocBaseUrl
in interfacePluginToolsRequest
- Parameters:
baseUrl
- may be relative to the current site's root- Returns:
- This request.
-
getInternalJavadocBaseUrl
- Specified by:
getInternalJavadocBaseUrl
in interfacePluginToolsRequest
- Returns:
- the javadoc base url for the internal classes
-
setInternalJavadocVersion
- Specified by:
setInternalJavadocVersion
in interfacePluginToolsRequest
- Parameters:
javadocVersion
-- Returns:
- This request.
-
getInternalJavadocVersion
- Specified by:
getInternalJavadocVersion
in interfacePluginToolsRequest
- Returns:
- the javadoc version used to create the internal javadoc site
-
setExternalJavadocBaseUrls
- Specified by:
setExternalJavadocBaseUrls
in interfacePluginToolsRequest
- Parameters:
javadocLinks
-- Returns:
- This request.
-
getExternalJavadocBaseUrls
- Specified by:
getExternalJavadocBaseUrls
in interfacePluginToolsRequest
- Returns:
- the list of external javadoc base urls to consider
-
setSettings
- Specified by:
setSettings
in interfacePluginToolsRequest
- Parameters:
settings
- the Maven settings- Returns:
- This request.
-
getSettings
- Specified by:
getSettings
in interfacePluginToolsRequest
- Returns:
- the Maven settings
-
setRequiredJavaVersion
- Specified by:
setRequiredJavaVersion
in interfacePluginToolsRequest
- Parameters:
requiredJavaVersion
- the required Java version for this plugin ornull
if unknown. Must be a value according to semantics ofVersionConstraint
.- Returns:
- This request.
-
getRequiredJavaVersion
- Specified by:
getRequiredJavaVersion
in interfacePluginToolsRequest
- Returns:
- the required Java version for this plugin or
null
if unknown. Is a value according to semantics ofVersionConstraint
.
-
setUsedMavenApiVersion
- Specified by:
setUsedMavenApiVersion
in interfacePluginToolsRequest
- Parameters:
mavenApiVersion
-- Returns:
- his request.
-
getUsedMavenApiVersion
- Specified by:
getUsedMavenApiVersion
in interfacePluginToolsRequest
- Returns:
- the Maven API version being referenced or
null
if unknown
-