org.apache.maven.repository.legacy
Class LegacyRepositorySystem
java.lang.Object
org.apache.maven.repository.legacy.LegacyRepositorySystem
- All Implemented Interfaces:
- RepositorySystem
@Component(role=RepositorySystem.class,
hint="default")
public class LegacyRepositorySystem
- extends Object
- implements RepositorySystem
- Author:
- Jason van Zyl
Method Summary |
ArtifactRepository |
buildArtifactRepository(Repository repo)
|
ArtifactRepositoryPolicy |
buildArtifactRepositoryPolicy(RepositoryPolicy policy)
|
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 repositoryId,
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 d)
|
Artifact |
createExtensionArtifact(String groupId,
String artifactId,
String version)
|
ArtifactRepository |
createLocalRepository(File localRepository)
|
ArtifactRepository |
createLocalRepository(String url,
String repositoryId)
|
Artifact |
createParentArtifact(String groupId,
String artifactId,
String version)
|
Artifact |
createPluginArtifact(Plugin plugin)
|
Artifact |
createProjectArtifact(String groupId,
String artifactId,
String metaVersionId)
|
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LegacyRepositorySystem
public LegacyRepositorySystem()
createArtifact
public Artifact createArtifact(String groupId,
String artifactId,
String version,
String scope,
String type)
- Specified by:
createArtifact
in interface RepositorySystem
createArtifact
public Artifact createArtifact(String groupId,
String artifactId,
String version,
String packaging)
- Specified by:
createArtifact
in interface RepositorySystem
createArtifactWithClassifier
public Artifact createArtifactWithClassifier(String groupId,
String artifactId,
String version,
String type,
String classifier)
- Specified by:
createArtifactWithClassifier
in interface RepositorySystem
createProjectArtifact
public Artifact createProjectArtifact(String groupId,
String artifactId,
String metaVersionId)
- Specified by:
createProjectArtifact
in interface RepositorySystem
createDependencyArtifact
public Artifact createDependencyArtifact(Dependency d)
- Specified by:
createDependencyArtifact
in interface RepositorySystem
createExtensionArtifact
public Artifact createExtensionArtifact(String groupId,
String artifactId,
String version)
createParentArtifact
public Artifact createParentArtifact(String groupId,
String artifactId,
String version)
createPluginArtifact
public Artifact createPluginArtifact(Plugin plugin)
- Specified by:
createPluginArtifact
in interface RepositorySystem
buildArtifactRepositoryPolicy
public ArtifactRepositoryPolicy buildArtifactRepositoryPolicy(RepositoryPolicy policy)
createDefaultLocalRepository
public ArtifactRepository createDefaultLocalRepository()
throws InvalidRepositoryException
- Specified by:
createDefaultLocalRepository
in interface RepositorySystem
- Throws:
InvalidRepositoryException
createLocalRepository
public ArtifactRepository createLocalRepository(File localRepository)
throws InvalidRepositoryException
- Specified by:
createLocalRepository
in interface RepositorySystem
- Throws:
InvalidRepositoryException
createDefaultRemoteRepository
public ArtifactRepository createDefaultRemoteRepository()
throws InvalidRepositoryException
- Specified by:
createDefaultRemoteRepository
in interface RepositorySystem
- Throws:
InvalidRepositoryException
createLocalRepository
public ArtifactRepository createLocalRepository(String url,
String repositoryId)
throws IOException
- Throws:
IOException
resolve
public ArtifactResolutionResult resolve(ArtifactResolutionRequest request)
- Specified by:
resolve
in interface RepositorySystem
getEffectiveRepositories
public List<ArtifactRepository> getEffectiveRepositories(List<ArtifactRepository> repositories)
- Description copied from interface:
RepositorySystem
- 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.
- Specified by:
getEffectiveRepositories
in interface RepositorySystem
- Parameters:
repositories
- The original repositories, may be null
.
- Returns:
- The effective repositories or
null
if the input was null
.
getMirror
public Mirror getMirror(ArtifactRepository repository,
List<Mirror> mirrors)
- Description copied from interface:
RepositorySystem
- Determines the mirror for the specified repository.
- Specified by:
getMirror
in interface RepositorySystem
- 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
public void injectMirror(List<ArtifactRepository> repositories,
List<Mirror> mirrors)
- Description copied from interface:
RepositorySystem
- 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
RepositorySystem.injectAuthentication(List, List)
or the repositories will end up with the wrong credentials.
- Specified by:
injectMirror
in interface RepositorySystem
- Parameters:
repositories
- The repositories into which to inject the mirror information, may be null
.mirrors
- The available mirrors, may be null
.
injectMirror
public void injectMirror(RepositorySystemSession session,
List<ArtifactRepository> repositories)
- Specified by:
injectMirror
in interface RepositorySystem
injectAuthentication
public void injectAuthentication(List<ArtifactRepository> repositories,
List<Server> servers)
- Description copied from interface:
RepositorySystem
- 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
RepositorySystem.injectMirror(List, List)
or the repositories will end up with the wrong credentials.
- Specified by:
injectAuthentication
in interface RepositorySystem
- Parameters:
repositories
- The repositories into which to inject the authentication information, may be null
.servers
- The available servers, may be null
.
injectAuthentication
public void injectAuthentication(RepositorySystemSession session,
List<ArtifactRepository> repositories)
- Specified by:
injectAuthentication
in interface RepositorySystem
injectProxy
public void injectProxy(List<ArtifactRepository> repositories,
List<Proxy> proxies)
- Description copied from interface:
RepositorySystem
- 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
RepositorySystem.injectMirror(List, List)
or the repositories will end up
with the wrong proxies.
- Specified by:
injectProxy
in interface RepositorySystem
- Parameters:
repositories
- The repositories into which to inject the proxy information, may be null
.proxies
- The available proxies, may be null
.
injectProxy
public void injectProxy(RepositorySystemSession session,
List<ArtifactRepository> repositories)
- Specified by:
injectProxy
in interface RepositorySystem
retrieve
public void retrieve(ArtifactRepository repository,
File destination,
String remotePath,
ArtifactTransferListener transferListener)
throws ArtifactTransferFailedException,
ArtifactDoesNotExistException
- Specified by:
retrieve
in interface RepositorySystem
- Throws:
ArtifactTransferFailedException
ArtifactDoesNotExistException
publish
public void publish(ArtifactRepository repository,
File source,
String remotePath,
ArtifactTransferListener transferListener)
throws ArtifactTransferFailedException
- Specified by:
publish
in interface RepositorySystem
- Throws:
ArtifactTransferFailedException
buildArtifactRepository
public ArtifactRepository buildArtifactRepository(Repository repo)
throws InvalidRepositoryException
- Specified by:
buildArtifactRepository
in interface RepositorySystem
- Throws:
InvalidRepositoryException
createArtifactRepository
public ArtifactRepository createArtifactRepository(String repositoryId,
String url,
ArtifactRepositoryLayout repositoryLayout,
ArtifactRepositoryPolicy snapshots,
ArtifactRepositoryPolicy releases)
- Specified by:
createArtifactRepository
in interface RepositorySystem
Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.