Class DefaultPluginVersionRequest

  • All Implemented Interfaces:
    PluginVersionRequest

    public class DefaultPluginVersionRequest
    extends java.lang.Object
    implements PluginVersionRequest
    Collects settings required to resolve the version for a plugin.
    Since:
    3.0
    • Field Detail

      • groupId

        private java.lang.String groupId
      • artifactId

        private java.lang.String artifactId
      • repositories

        private java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories
      • session

        private org.eclipse.aether.RepositorySystemSession session
    • Constructor Detail

      • DefaultPluginVersionRequest

        public DefaultPluginVersionRequest()
        Creates an empty request.
      • DefaultPluginVersionRequest

        public DefaultPluginVersionRequest​(Plugin plugin,
                                           MavenSession session)
        Creates a request for the specified plugin by copying settings from the specified build session. If the session has a current project, its plugin repositories will be used as well.
        Parameters:
        plugin - The plugin for which to resolve a version, must not be null.
        session - The Maven session to use, must not be null.
      • DefaultPluginVersionRequest

        public DefaultPluginVersionRequest​(Plugin plugin,
                                           org.eclipse.aether.RepositorySystemSession session,
                                           java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories)
        Creates a request for the specified plugin using the given repository session and plugin repositories.
        Parameters:
        plugin - The plugin for which to resolve a version, must not be null.
        session - The repository session to use, must not be null.
        repositories - The plugin repositories to query, may be null.
    • Method Detail

      • getPom

        public Model getPom()
        Description copied from interface: PluginVersionRequest
        Gets the POM whose build plugins are to be scanned for the version.
        Specified by:
        getPom in interface PluginVersionRequest
        Returns:
        The POM whose build plugins are to be scanned for the version or null to only search the plugin repositories.
      • setPom

        public DefaultPluginVersionRequest setPom​(Model pom)
        Description copied from interface: PluginVersionRequest
        Sets the POM whose build plugins are to be scanned for the version.
        Specified by:
        setPom in interface PluginVersionRequest
        Parameters:
        pom - The POM whose build plugins are to be scanned for the version, may be null to only search the plugin repositories.
        Returns:
        This request, never null.
      • getRepositories

        public java.util.List<org.eclipse.aether.repository.RemoteRepository> getRepositories()
        Description copied from interface: PluginVersionRequest
        Gets the remote repositories to use.
        Specified by:
        getRepositories in interface PluginVersionRequest
        Returns:
        The remote repositories to use, never null.
      • setRepositories

        public DefaultPluginVersionRequest setRepositories​(java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories)
        Description copied from interface: PluginVersionRequest
        Sets the remote repositories to use. Note: When creating a request from a project, be sure to use the plugin repositories and not the regular project repositories.
        Specified by:
        setRepositories in interface PluginVersionRequest
        Parameters:
        repositories - The remote repositories to use.
        Returns:
        This request, never null.
      • getRepositorySession

        public org.eclipse.aether.RepositorySystemSession getRepositorySession()
        Description copied from interface: PluginVersionRequest
        Gets the session to use for repository access.
        Specified by:
        getRepositorySession in interface PluginVersionRequest
        Returns:
        The repository session or null if not set.