Package org.apache.maven.plugin.prefix
Class DefaultPluginPrefixRequest
- java.lang.Object
-
- org.apache.maven.plugin.prefix.DefaultPluginPrefixRequest
-
- All Implemented Interfaces:
PluginPrefixRequest
public class DefaultPluginPrefixRequest extends java.lang.Object implements PluginPrefixRequest
Collects settings required to resolve a plugin prefix.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>pluginGroupsprivate Modelpomprivate java.lang.Stringprefixprivate java.util.List<org.eclipse.aether.repository.RemoteRepository>repositoriesprivate org.eclipse.aether.RepositorySystemSessionsession
-
Constructor Summary
Constructors Constructor Description DefaultPluginPrefixRequest()Creates an empty request.DefaultPluginPrefixRequest(java.lang.String prefix, MavenSession session)Creates a request for the specified plugin prefix and build session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getPluginGroups()Gets the list of group ids to scan for the plugin prefix.ModelgetPom()Gets the POM whose build plugins are to be scanned for the prefix.java.lang.StringgetPrefix()Gets the prefix of the plugin.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.DefaultPluginPrefixRequestsetPluginGroups(java.util.List<java.lang.String> pluginGroups)Sets the list of group ids to scan for the plugin prefix.DefaultPluginPrefixRequestsetPom(Model pom)Sets the POM whose build plugins are to be scanned for the prefix.DefaultPluginPrefixRequestsetPrefix(java.lang.String prefix)Sets the prefix of the plugin.DefaultPluginPrefixRequestsetRepositories(java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories)Sets the remote repositories to use.DefaultPluginPrefixRequestsetRepositorySession(org.eclipse.aether.RepositorySystemSession session)Sets the session to use for repository access.
-
-
-
Field Detail
-
prefix
private java.lang.String prefix
-
pluginGroups
private java.util.List<java.lang.String> pluginGroups
-
pom
private Model pom
-
repositories
private java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories
-
session
private org.eclipse.aether.RepositorySystemSession session
-
-
Constructor Detail
-
DefaultPluginPrefixRequest
public DefaultPluginPrefixRequest()
Creates an empty request.
-
DefaultPluginPrefixRequest
public DefaultPluginPrefixRequest(java.lang.String prefix, MavenSession session)Creates a request for the specified plugin prefix and build session. The provided build session will be used to configure repository settings. If the session has a current project, its plugin repositories and model will be used as well.- Parameters:
prefix- The plugin prefix to resolve, must not benull.session- The build session from which to derive further settings, must not benull.
-
-
Method Detail
-
getPrefix
public java.lang.String getPrefix()
Description copied from interface:PluginPrefixRequestGets the prefix of the plugin.- Specified by:
getPrefixin interfacePluginPrefixRequest- Returns:
- The prefix of the plugin.
-
setPrefix
public DefaultPluginPrefixRequest setPrefix(java.lang.String prefix)
Description copied from interface:PluginPrefixRequestSets the prefix of the plugin.- Specified by:
setPrefixin interfacePluginPrefixRequest- Parameters:
prefix- The prefix of the plugin.- Returns:
- This request, never
null.
-
getPluginGroups
public java.util.List<java.lang.String> getPluginGroups()
Description copied from interface:PluginPrefixRequestGets the list of group ids to scan for the plugin prefix.- Specified by:
getPluginGroupsin interfacePluginPrefixRequest- Returns:
- The list of group ids to scan for the plugin prefix, never
null.
-
setPluginGroups
public DefaultPluginPrefixRequest setPluginGroups(java.util.List<java.lang.String> pluginGroups)
Description copied from interface:PluginPrefixRequestSets the list of group ids to scan for the plugin prefix.- Specified by:
setPluginGroupsin interfacePluginPrefixRequest- Parameters:
pluginGroups- The list of group ids to scan for the plugin prefix, may benull.- Returns:
- This request, never
null.
-
getPom
public Model getPom()
Description copied from interface:PluginPrefixRequestGets the POM whose build plugins are to be scanned for the prefix.- Specified by:
getPomin interfacePluginPrefixRequest- Returns:
- The POM whose build plugins are to be scanned for the prefix or
nullto only search the plugin repositories.
-
setPom
public DefaultPluginPrefixRequest setPom(Model pom)
Description copied from interface:PluginPrefixRequestSets the POM whose build plugins are to be scanned for the prefix.- Specified by:
setPomin interfacePluginPrefixRequest- Parameters:
pom- The POM whose build plugins are to be scanned for the prefix, 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:PluginPrefixRequestGets the remote repositories to use.- Specified by:
getRepositoriesin interfacePluginPrefixRequest- Returns:
- The remote repositories to use, never
null.
-
setRepositories
public DefaultPluginPrefixRequest setRepositories(java.util.List<org.eclipse.aether.repository.RemoteRepository> repositories)
Description copied from interface:PluginPrefixRequestSets 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 interfacePluginPrefixRequest- Parameters:
repositories- The remote repositories to use.- Returns:
- This request, never
null.
-
getRepositorySession
public org.eclipse.aether.RepositorySystemSession getRepositorySession()
Description copied from interface:PluginPrefixRequestGets the session to use for repository access.- Specified by:
getRepositorySessionin interfacePluginPrefixRequest- Returns:
- The repository session or
nullif not set.
-
setRepositorySession
public DefaultPluginPrefixRequest setRepositorySession(org.eclipse.aether.RepositorySystemSession session)
Description copied from interface:PluginPrefixRequestSets the session to use for repository access.- Specified by:
setRepositorySessionin interfacePluginPrefixRequest- Parameters:
session- The repository session to use.- Returns:
- This request, never
null.
-
-