org.apache.maven.plugin.prefix
Class DefaultPluginPrefixRequest

java.lang.Object
  extended by org.apache.maven.plugin.prefix.DefaultPluginPrefixRequest
All Implemented Interfaces:
PluginPrefixRequest

public class DefaultPluginPrefixRequest
extends Object
implements PluginPrefixRequest

Collects settings required to resolve a plugin prefix.

Since:
3.0
Author:
Benjamin Bentmann

Constructor Summary
DefaultPluginPrefixRequest()
          Creates an empty request.
DefaultPluginPrefixRequest(String prefix, MavenSession session)
          Creates a request for the specified plugin prefix and build session.
 
Method Summary
 List<String> getPluginGroups()
          Gets the list of group ids to scan for the plugin prefix.
 Model getPom()
          Gets the POM whose build plugins are to be scanned for the prefix.
 String getPrefix()
          Gets the prefix of the plugin.
 List<RemoteRepository> getRepositories()
          Gets the remote repositories to use.
 RepositorySystemSession getRepositorySession()
          Gets the session to use for repository access.
 DefaultPluginPrefixRequest setPluginGroups(List<String> pluginGroups)
          Sets the list of group ids to scan for the plugin prefix.
 DefaultPluginPrefixRequest setPom(Model pom)
          Sets the POM whose build plugins are to be scanned for the prefix.
 DefaultPluginPrefixRequest setPrefix(String prefix)
          Sets the prefix of the plugin.
 DefaultPluginPrefixRequest setRepositories(List<RemoteRepository> repositories)
          Sets the remote repositories to use.
 DefaultPluginPrefixRequest setRepositorySession(RepositorySystemSession session)
          Sets the session to use for repository access.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPluginPrefixRequest

public DefaultPluginPrefixRequest()
Creates an empty request.


DefaultPluginPrefixRequest

public DefaultPluginPrefixRequest(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 be null.
session - The build session from which to derive further settings, must not be null.
Method Detail

getPrefix

public String getPrefix()
Description copied from interface: PluginPrefixRequest
Gets the prefix of the plugin.

Specified by:
getPrefix in interface PluginPrefixRequest
Returns:
The prefix of the plugin.

setPrefix

public DefaultPluginPrefixRequest setPrefix(String prefix)
Description copied from interface: PluginPrefixRequest
Sets the prefix of the plugin.

Specified by:
setPrefix in interface PluginPrefixRequest
Parameters:
prefix - The prefix of the plugin.
Returns:
This request, never null.

getPluginGroups

public List<String> getPluginGroups()
Description copied from interface: PluginPrefixRequest
Gets the list of group ids to scan for the plugin prefix.

Specified by:
getPluginGroups in interface PluginPrefixRequest
Returns:
The list of group ids to scan for the plugin prefix, never null.

setPluginGroups

public DefaultPluginPrefixRequest setPluginGroups(List<String> pluginGroups)
Description copied from interface: PluginPrefixRequest
Sets the list of group ids to scan for the plugin prefix.

Specified by:
setPluginGroups in interface PluginPrefixRequest
Parameters:
pluginGroups - The list of group ids to scan for the plugin prefix, may be null.
Returns:
This request, never null.

getPom

public Model getPom()
Description copied from interface: PluginPrefixRequest
Gets the POM whose build plugins are to be scanned for the prefix.

Specified by:
getPom in interface PluginPrefixRequest
Returns:
The POM whose build plugins are to be scanned for the prefix or null to only search the plugin repositories.

setPom

public DefaultPluginPrefixRequest setPom(Model pom)
Description copied from interface: PluginPrefixRequest
Sets the POM whose build plugins are to be scanned for the prefix.

Specified by:
setPom in interface PluginPrefixRequest
Parameters:
pom - The POM whose build plugins are to be scanned for the prefix, may be null to only search the plugin repositories.
Returns:
This request, never null.

getRepositories

public List<RemoteRepository> getRepositories()
Description copied from interface: PluginPrefixRequest
Gets the remote repositories to use.

Specified by:
getRepositories in interface PluginPrefixRequest
Returns:
The remote repositories to use, never null.

setRepositories

public DefaultPluginPrefixRequest setRepositories(List<RemoteRepository> repositories)
Description copied from interface: PluginPrefixRequest
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 PluginPrefixRequest
Parameters:
repositories - The remote repositories to use.
Returns:
This request, never null.

getRepositorySession

public RepositorySystemSession getRepositorySession()
Description copied from interface: PluginPrefixRequest
Gets the session to use for repository access.

Specified by:
getRepositorySession in interface PluginPrefixRequest
Returns:
The repository session or null if not set.

setRepositorySession

public DefaultPluginPrefixRequest setRepositorySession(RepositorySystemSession session)
Description copied from interface: PluginPrefixRequest
Sets the session to use for repository access.

Specified by:
setRepositorySession in interface PluginPrefixRequest
Parameters:
session - The repository session to use.
Returns:
This request, never null.


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.