o Simplified API

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@821164 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-10-02 20:45:58 +00:00
parent 608ac9f30c
commit f5b47d1a8a
3 changed files with 22 additions and 6 deletions

View File

@ -1768,7 +1768,7 @@ public class DefaultLifecycleExecutor
{
// [prefix]:[goal]
PluginPrefixRequest prefixRequest = new DefaultPluginPrefixRequest( session ).setPrefix( prefix );
PluginPrefixRequest prefixRequest = new DefaultPluginPrefixRequest( prefix, session );
PluginPrefixResult prefixResult = pluginPrefixResolver.resolve( prefixRequest );
Plugin plugin = new Plugin();

View File

@ -173,8 +173,7 @@ public class DefaultPluginManager
public Plugin getPluginDefinitionForPrefix( String prefix, MavenSession session, MavenProject project )
{
PluginPrefixRequest request = new DefaultPluginPrefixRequest( session );
request.setPrefix( prefix );
PluginPrefixRequest request = new DefaultPluginPrefixRequest( prefix, session );
request.setPom( project.getModel() );
try
@ -197,8 +196,7 @@ public class DefaultPluginManager
{
MavenSession session = legacySupport.getSession();
PluginPrefixRequest request = new DefaultPluginPrefixRequest( session );
request.setPrefix( prefix );
PluginPrefixRequest request = new DefaultPluginPrefixRequest( prefix, session );
try
{

View File

@ -47,18 +47,36 @@ public class DefaultPluginPrefixRequest
private RepositoryRequest repositoryRequest;
/**
* Creates an empty request.
*/
public DefaultPluginPrefixRequest()
{
repositoryRequest = new DefaultRepositoryRequest();
}
/**
* Creates a request by copying settings from the specified repository request.
*
* @param repositoryRequest The repository request to copy from, must not be {@code null}.
*/
public DefaultPluginPrefixRequest( RepositoryRequest repositoryRequest )
{
this.repositoryRequest = new DefaultRepositoryRequest( repositoryRequest );
}
public DefaultPluginPrefixRequest( 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 artifact repositories and model
* will be used as well.
*
* @param prefix The plugin prefix to resolve, must not be {@code null}.
* @param session The build session from which to derive further settings, must not be {@code null}.
*/
public DefaultPluginPrefixRequest( String prefix, MavenSession session )
{
setPrefix( prefix );
this.repositoryRequest = new DefaultRepositoryRequest();
setCache( session.getRepositoryCache() );