Class DefaultPluginToolsRequest

java.lang.Object
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
  • Field Details

    • DEFAULT_ENCODING

      private static final String DEFAULT_ENCODING
    • pluginDescriptor

      private org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor
    • project

      private org.apache.maven.project.MavenProject project
    • encoding

      private String encoding
    • skipErrorNoDescriptorsFound

      private boolean skipErrorNoDescriptorsFound
    • dependencies

      private Set<org.apache.maven.artifact.Artifact> dependencies
    • remoteRepos

      private List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos
    • local

      private org.apache.maven.artifact.repository.ArtifactRepository local
  • Constructor Details

    • DefaultPluginToolsRequest

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

    • getPluginDescriptor

      public org.apache.maven.plugin.descriptor.PluginDescriptor getPluginDescriptor()
      Specified by:
      getPluginDescriptor in interface PluginToolsRequest
      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 interface PluginToolsRequest
      Parameters:
      pluginDescriptor - the PluginDescriptor
      Returns:
      This request.
      See Also:
    • getProject

      public org.apache.maven.project.MavenProject getProject()
      Specified by:
      getProject in interface PluginToolsRequest
      Returns:
      Return the current MavenProject instance in use.
    • setProject

      public PluginToolsRequest setProject(org.apache.maven.project.MavenProject project)
      Specified by:
      setProject in interface PluginToolsRequest
      Parameters:
      project - the current MavenProject
      Returns:
      This request.
      See Also:
    • 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:
      true if no descriptor found should not cause a failure
    • 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
      Parameters:
      skipErrorNoDescriptorsFound - true to skip errors because of not found descriptors
      Returns:
      This request.
    • 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:
      the dependencies
    • setDependencies

      public PluginToolsRequest setDependencies(Set<org.apache.maven.artifact.Artifact> dependencies)
      Specified by:
      setDependencies in interface PluginToolsRequest
      Parameters:
      dependencies - the dependencies
      Returns:
      This request.
    • getRemoteRepos

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

      public PluginToolsRequest setRemoteRepos(List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepos)
      Specified by:
      setRemoteRepos in interface PluginToolsRequest
      Parameters:
      remoteRepos - the remote repositories
      Returns:
      This request.
    • getLocal

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

      public PluginToolsRequest setLocal(org.apache.maven.artifact.repository.ArtifactRepository local)
      Specified by:
      setLocal in interface PluginToolsRequest
      Parameters:
      local - the local repository
      Returns:
      This request.