org.apache.maven.repository
Interface RepositorySystem


public interface RepositorySystem

Author:
Jason van Zyl

Field Summary
static String DEFAULT_LOCAL_REPO_ID
           
static String DEFAULT_REMOTE_REPO_ID
           
static String DEFAULT_REMOTE_REPO_URL
           
static File defaultUserLocalRepository
           
static String userHome
           
static File userMavenConfigurationHome
           
 
Method Summary
 ArtifactRepository buildArtifactRepository(Repository repository)
           
 Artifact createArtifact(String groupId, String artifactId, String version, String packaging)
           
 Artifact createArtifact(String groupId, String artifactId, String version, String scope, String type)
           
 ArtifactRepository createArtifactRepository(String id, String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases)
           
 Artifact createArtifactWithClassifier(String groupId, String artifactId, String version, String type, String classifier)
           
 ArtifactRepository createDefaultLocalRepository()
           
 ArtifactRepository createDefaultRemoteRepository()
           
 Artifact createDependencyArtifact(Dependency dependency)
           
 ArtifactRepository createLocalRepository(File localRepository)
           
 Artifact createPluginArtifact(Plugin plugin)
           
 Artifact createProjectArtifact(String groupId, String artifactId, String version)
           
 List<ArtifactRepository> getEffectiveRepositories(List<ArtifactRepository> repositories)
          Calculates the effective repositories for the given input repositories which are assumed to be already mirrored (if applicable).
 Mirror getMirror(ArtifactRepository repository, List<Mirror> mirrors)
          Determines the mirror for the specified repository.
 void injectAuthentication(List<ArtifactRepository> repositories, List<Server> servers)
          Injects the authentication information into the specified repositories.
 void injectAuthentication(RepositorySystemSession session, List<ArtifactRepository> repositories)
           
 void injectMirror(List<ArtifactRepository> repositories, List<Mirror> mirrors)
          Injects the mirroring information into the specified repositories.
 void injectMirror(RepositorySystemSession session, List<ArtifactRepository> repositories)
           
 void injectProxy(List<ArtifactRepository> repositories, List<Proxy> proxies)
          Injects the proxy information into the specified repositories.
 void injectProxy(RepositorySystemSession session, List<ArtifactRepository> repositories)
           
 void publish(ArtifactRepository repository, File source, String remotePath, ArtifactTransferListener transferListener)
           
 ArtifactResolutionResult resolve(ArtifactResolutionRequest request)
           
 void retrieve(ArtifactRepository repository, File destination, String remotePath, ArtifactTransferListener transferListener)
           
 

Field Detail

DEFAULT_LOCAL_REPO_ID

static final String DEFAULT_LOCAL_REPO_ID
See Also:
Constant Field Values

userHome

static final String userHome

userMavenConfigurationHome

static final File userMavenConfigurationHome

defaultUserLocalRepository

static final File defaultUserLocalRepository

DEFAULT_REMOTE_REPO_ID

static final String DEFAULT_REMOTE_REPO_ID
See Also:
Constant Field Values

DEFAULT_REMOTE_REPO_URL

static final String DEFAULT_REMOTE_REPO_URL
See Also:
Constant Field Values
Method Detail

createArtifact

Artifact createArtifact(String groupId,
                        String artifactId,
                        String version,
                        String packaging)

createArtifact

Artifact createArtifact(String groupId,
                        String artifactId,
                        String version,
                        String scope,
                        String type)

createProjectArtifact

Artifact createProjectArtifact(String groupId,
                               String artifactId,
                               String version)

createArtifactWithClassifier

Artifact createArtifactWithClassifier(String groupId,
                                      String artifactId,
                                      String version,
                                      String type,
                                      String classifier)

createPluginArtifact

Artifact createPluginArtifact(Plugin plugin)

createDependencyArtifact

Artifact createDependencyArtifact(Dependency dependency)

buildArtifactRepository

ArtifactRepository buildArtifactRepository(Repository repository)
                                           throws InvalidRepositoryException
Throws:
InvalidRepositoryException

createDefaultRemoteRepository

ArtifactRepository createDefaultRemoteRepository()
                                                 throws InvalidRepositoryException
Throws:
InvalidRepositoryException

createDefaultLocalRepository

ArtifactRepository createDefaultLocalRepository()
                                                throws InvalidRepositoryException
Throws:
InvalidRepositoryException

createLocalRepository

ArtifactRepository createLocalRepository(File localRepository)
                                         throws InvalidRepositoryException
Throws:
InvalidRepositoryException

createArtifactRepository

ArtifactRepository createArtifactRepository(String id,
                                            String url,
                                            ArtifactRepositoryLayout repositoryLayout,
                                            ArtifactRepositoryPolicy snapshots,
                                            ArtifactRepositoryPolicy releases)

getEffectiveRepositories

List<ArtifactRepository> getEffectiveRepositories(List<ArtifactRepository> repositories)
Calculates the effective repositories for the given input repositories which are assumed to be already mirrored (if applicable). This process will essentially remove duplicate repositories by merging them into one equivalent repository. It is worth to point out that merging does not simply choose one of the input repositories and discards the others but actually combines their possibly different policies.

Parameters:
repositories - The original repositories, may be null.
Returns:
The effective repositories or null if the input was null.

getMirror

Mirror getMirror(ArtifactRepository repository,
                 List<Mirror> mirrors)
Determines the mirror for the specified repository.

Parameters:
repository - The repository to determine the mirror for, must not be null.
mirrors - The available mirrors, may be null.
Returns:
The mirror specification for the repository or null if no mirror matched.

injectMirror

void injectMirror(List<ArtifactRepository> repositories,
                  List<Mirror> mirrors)
Injects the mirroring information into the specified repositories. For each repository that is matched by a mirror, its URL and ID will be updated to match the values from the mirror specification. Repositories without a matching mirror will pass through unchanged. Note: This method must be called before injectAuthentication(List, List) or the repositories will end up with the wrong credentials.

Parameters:
repositories - The repositories into which to inject the mirror information, may be null.
mirrors - The available mirrors, may be null.

injectProxy

void injectProxy(List<ArtifactRepository> repositories,
                 List<Proxy> proxies)
Injects the proxy information into the specified repositories. For each repository that is matched by a proxy, its proxy data will be set accordingly. Repositories without a matching proxy will have their proxy cleared. Note: This method must be called after injectMirror(List, List) or the repositories will end up with the wrong proxies.

Parameters:
repositories - The repositories into which to inject the proxy information, may be null.
proxies - The available proxies, may be null.

injectAuthentication

void injectAuthentication(List<ArtifactRepository> repositories,
                          List<Server> servers)
Injects the authentication information into the specified repositories. For each repository that is matched by a server, its credentials will be updated to match the values from the server specification. Repositories without a matching server will have their credentials cleared. Note: This method must be called after injectMirror(List, List) or the repositories will end up with the wrong credentials.

Parameters:
repositories - The repositories into which to inject the authentication information, may be null.
servers - The available servers, may be null.

injectMirror

void injectMirror(RepositorySystemSession session,
                  List<ArtifactRepository> repositories)

injectProxy

void injectProxy(RepositorySystemSession session,
                 List<ArtifactRepository> repositories)

injectAuthentication

void injectAuthentication(RepositorySystemSession session,
                          List<ArtifactRepository> repositories)

resolve

ArtifactResolutionResult resolve(ArtifactResolutionRequest request)

publish

void publish(ArtifactRepository repository,
             File source,
             String remotePath,
             ArtifactTransferListener transferListener)
             throws ArtifactTransferFailedException
Throws:
ArtifactTransferFailedException

retrieve

void retrieve(ArtifactRepository repository,
              File destination,
              String remotePath,
              ArtifactTransferListener transferListener)
              throws ArtifactTransferFailedException,
                     ArtifactDoesNotExistException
Throws:
ArtifactTransferFailedException
ArtifactDoesNotExistException


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