Package org.apache.maven.plugin.version
Class DefaultPluginVersionRequest
- java.lang.Object
-
- org.apache.maven.plugin.version.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 Summary
Fields Modifier and Type Field Description private java.lang.StringartifactIdprivate java.lang.StringgroupIdprivate Modelpomprivate java.util.List<org.eclipse.aether.repository.RemoteRepository>repositoriesprivate org.eclipse.aether.RepositorySystemSessionsession
-
Constructor Summary
Constructors Constructor Description DefaultPluginVersionRequest()Creates an empty request.DefaultPluginVersionRequest(Plugin plugin, MavenSession session)Creates a request for the specified plugin by copying settings from the specified build session.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetArtifactId()Gets the artifact id of the plugin.java.lang.StringgetGroupId()Gets the group id of the plugin.ModelgetPom()Gets the POM whose build plugins are to be scanned for the version.java.util.List<org.eclipse.aether.repository.RemoteRepository>getRepositories()Gets the remote repositories to use.org.eclipse.aether.RepositorySystemSessiongetRepositorySession()Gets the session to use for repository access.DefaultPluginVersionRequestsetArtifactId(java.lang.String artifactId)Sets the artifact id of the plugin.DefaultPluginVersionRequestsetGroupId(java.lang.String groupId)Sets the group id of the plugin.DefaultPluginVersionRequestsetPom(Model pom)Sets the POM whose build plugins are to be scanned for the version.DefaultPluginVersionRequestsetRepositories(java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories)Sets the remote repositories to use.DefaultPluginVersionRequestsetRepositorySession(org.eclipse.aether.RepositorySystemSession session)Sets the session to use for repository access.
-
-
-
Field Detail
-
groupId
private java.lang.String groupId
-
artifactId
private java.lang.String artifactId
-
pom
private Model pom
-
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 benull.session- The Maven session to use, must not benull.
-
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 benull.session- The repository session to use, must not benull.repositories- The plugin repositories to query, may benull.
-
-
Method Detail
-
getGroupId
public java.lang.String getGroupId()
Description copied from interface:PluginVersionRequestGets the group id of the plugin.- Specified by:
getGroupIdin interfacePluginVersionRequest- Returns:
- The group id of the plugin.
-
setGroupId
public DefaultPluginVersionRequest setGroupId(java.lang.String groupId)
Description copied from interface:PluginVersionRequestSets the group id of the plugin.- Specified by:
setGroupIdin interfacePluginVersionRequest- Parameters:
groupId- The group id of the plugin.- Returns:
- This request, never
null.
-
getArtifactId
public java.lang.String getArtifactId()
Description copied from interface:PluginVersionRequestGets the artifact id of the plugin.- Specified by:
getArtifactIdin interfacePluginVersionRequest- Returns:
- The artifact id of the plugin.
-
setArtifactId
public DefaultPluginVersionRequest setArtifactId(java.lang.String artifactId)
Description copied from interface:PluginVersionRequestSets the artifact id of the plugin.- Specified by:
setArtifactIdin interfacePluginVersionRequest- Parameters:
artifactId- The artifact id of the plugin.- Returns:
- This request, never
null.
-
getPom
public Model getPom()
Description copied from interface:PluginVersionRequestGets the POM whose build plugins are to be scanned for the version.- Specified by:
getPomin interfacePluginVersionRequest- Returns:
- The POM whose build plugins are to be scanned for the version or
nullto only search the plugin repositories.
-
setPom
public DefaultPluginVersionRequest setPom(Model pom)
Description copied from interface:PluginVersionRequestSets the POM whose build plugins are to be scanned for the version.- Specified by:
setPomin interfacePluginVersionRequest- Parameters:
pom- The POM whose build plugins are to be scanned for the version, may benullto 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:PluginVersionRequestGets the remote repositories to use.- Specified by:
getRepositoriesin interfacePluginVersionRequest- 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:PluginVersionRequestSets 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:
setRepositoriesin interfacePluginVersionRequest- Parameters:
repositories- The remote repositories to use.- Returns:
- This request, never
null.
-
getRepositorySession
public org.eclipse.aether.RepositorySystemSession getRepositorySession()
Description copied from interface:PluginVersionRequestGets the session to use for repository access.- Specified by:
getRepositorySessionin interfacePluginVersionRequest- Returns:
- The repository session or
nullif not set.
-
setRepositorySession
public DefaultPluginVersionRequest setRepositorySession(org.eclipse.aether.RepositorySystemSession session)
Description copied from interface:PluginVersionRequestSets the session to use for repository access.- Specified by:
setRepositorySessionin interfacePluginVersionRequest- Parameters:
session- The repository session to use.- Returns:
- This request, never
null.
-
-