Class 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 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()
        Specified by:
        getPluginDescriptor in interface PluginToolsRequest
        Returns:
        Return the PluginDescriptor currently being populated as part of the build of the current plugin project.
      • getProject

        public org.apache.maven.project.MavenProject getProject()
        Specified by:
        getProject in interface PluginToolsRequest
        Returns:
        Return the current MavenProject instance in use.
      • 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.
      • 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
      • 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.