org.apache.maven.plugin.version
Class DefaultPluginVersionRequest

java.lang.Object
  extended by org.apache.maven.plugin.version.DefaultPluginVersionRequest
All Implemented Interfaces:
PluginVersionRequest

public class DefaultPluginVersionRequest
extends Object
implements PluginVersionRequest

Collects settings required to resolve the version for a plugin.

Since:
3.0
Author:
Benjamin Bentmann

Constructor Summary
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.sonatype.aether.RepositorySystemSession session, List<org.sonatype.aether.repository.RemoteRepository> repositories)
          Creates a request for the specified plugin using the given repository session and plugin repositories.
 
Method Summary
 String getArtifactId()
          Gets the artifact id of the plugin.
 String getGroupId()
          Gets the group id of the plugin.
 Model getPom()
          Gets the POM whose build plugins are to be scanned for the version.
 List<org.sonatype.aether.repository.RemoteRepository> getRepositories()
          Gets the remote repositories to use.
 org.sonatype.aether.RepositorySystemSession getRepositorySession()
          Gets the session to use for repository access.
 DefaultPluginVersionRequest setArtifactId(String artifactId)
          Sets the artifact id of the plugin.
 DefaultPluginVersionRequest setGroupId(String groupId)
          Sets the group id of the plugin.
 DefaultPluginVersionRequest setPom(Model pom)
          Sets the POM whose build plugins are to be scanned for the version.
 DefaultPluginVersionRequest setRepositories(List<org.sonatype.aether.repository.RemoteRepository> repositories)
          Sets the remote repositories to use.
 DefaultPluginVersionRequest setRepositorySession(org.sonatype.aether.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

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.
repositoryRequest - The repository request to copy from, must not be null.

DefaultPluginVersionRequest

public DefaultPluginVersionRequest(Plugin plugin,
                                   org.sonatype.aether.RepositorySystemSession session,
                                   List<org.sonatype.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

getGroupId

public String getGroupId()
Description copied from interface: PluginVersionRequest
Gets the group id of the plugin.

Specified by:
getGroupId in interface PluginVersionRequest
Returns:
The group id of the plugin.

setGroupId

public DefaultPluginVersionRequest setGroupId(String groupId)
Description copied from interface: PluginVersionRequest
Sets the group id of the plugin.

Specified by:
setGroupId in interface PluginVersionRequest
Parameters:
groupId - The group id of the plugin.
Returns:
This request, never null.

getArtifactId

public String getArtifactId()
Description copied from interface: PluginVersionRequest
Gets the artifact id of the plugin.

Specified by:
getArtifactId in interface PluginVersionRequest
Returns:
The artifact id of the plugin.

setArtifactId

public DefaultPluginVersionRequest setArtifactId(String artifactId)
Description copied from interface: PluginVersionRequest
Sets the artifact id of the plugin.

Specified by:
setArtifactId in interface PluginVersionRequest
Parameters:
artifactId - The artifact id of the plugin.
Returns:
This request, never null.

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 verion 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 List<org.sonatype.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(List<org.sonatype.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.sonatype.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.

setRepositorySession

public DefaultPluginVersionRequest setRepositorySession(org.sonatype.aether.RepositorySystemSession session)
Description copied from interface: PluginVersionRequest
Sets the session to use for repository access.

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


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