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
-
Field Summary
Fields inherited from interface org.apache.maven.repository.RepositorySystem
DEFAULT_LOCAL_REPO_ID, DEFAULT_REMOTE_REPO_ID, DEFAULT_REMOTE_REPO_URL, defaultUserLocalRepository, userHome, userMavenConfigurationHome -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateArtifact(String groupId, String artifactId, String version, String packaging) createArtifactRepository(String repositoryId, String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases) createArtifactWithClassifier(String groupId, String artifactId, String version, String type, String classifier) createExtensionArtifact(String groupId, String artifactId, String version) createLocalRepository(File localRepository) createLocalRepository(String url, String repositoryId) createParentArtifact(String groupId, String artifactId, String version) createPluginArtifact(Plugin plugin) createProjectArtifact(String groupId, String artifactId, String metaVersionId) getEffectiveRepositories(List<ArtifactRepository> repositories) Calculates the effective repositories for the given input repositories which are assumed to be already mirrored (if applicable).getMirror(ArtifactRepository repository, List<Mirror> mirrors) Determines the mirror for the specified repository.voidinjectAuthentication(List<ArtifactRepository> repositories, List<Server> servers) Injects the authentication information into the specified repositories.voidinjectAuthentication(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) voidinjectMirror(List<ArtifactRepository> repositories, List<Mirror> mirrors) Injects the mirroring information into the specified repositories.voidinjectMirror(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) voidinjectProxy(List<ArtifactRepository> repositories, List<Proxy> proxies) Injects the proxy information into the specified repositories.voidinjectProxy(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) voidpublish(ArtifactRepository repository, File source, String remotePath, ArtifactTransferListener transferListener) resolve(ArtifactResolutionRequest request) voidretrieve(ArtifactRepository repository, File destination, String remotePath, ArtifactTransferListener transferListener)
-
Constructor Details
-
LegacyRepositorySystem
public LegacyRepositorySystem()
-
-
Method Details
-
createArtifact
public Artifact createArtifact(String groupId, String artifactId, String version, String scope, String type) - Specified by:
createArtifactin interfaceRepositorySystem
-
createArtifact
- Specified by:
createArtifactin interfaceRepositorySystem
-
createArtifactWithClassifier
public Artifact createArtifactWithClassifier(String groupId, String artifactId, String version, String type, String classifier) - Specified by:
createArtifactWithClassifierin interfaceRepositorySystem
-
createProjectArtifact
- Specified by:
createProjectArtifactin interfaceRepositorySystem
-
createDependencyArtifact
- Specified by:
createDependencyArtifactin interfaceRepositorySystem
-
createExtensionArtifact
-
createParentArtifact
-
createPluginArtifact
- Specified by:
createPluginArtifactin interfaceRepositorySystem
-
buildArtifactRepositoryPolicy
-
createDefaultLocalRepository
- Specified by:
createDefaultLocalRepositoryin interfaceRepositorySystem- Throws:
InvalidRepositoryException
-
createLocalRepository
public ArtifactRepository createLocalRepository(File localRepository) throws InvalidRepositoryException - Specified by:
createLocalRepositoryin interfaceRepositorySystem- Throws:
InvalidRepositoryException
-
createDefaultRemoteRepository
- Specified by:
createDefaultRemoteRepositoryin interfaceRepositorySystem- Throws:
InvalidRepositoryException
-
createLocalRepository
- Throws:
IOException
-
resolve
- Specified by:
resolvein interfaceRepositorySystem
-
getEffectiveRepositories
Description copied from interface:RepositorySystemCalculates 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:
getEffectiveRepositoriesin interfaceRepositorySystem- Parameters:
repositories- The original repositories, may benull.- Returns:
- The effective repositories or
nullif the input wasnull.
-
getMirror
Description copied from interface:RepositorySystemDetermines the mirror for the specified repository.- Specified by:
getMirrorin interfaceRepositorySystem- Parameters:
repository- The repository to determine the mirror for, must not benull.mirrors- The available mirrors, may benull.- Returns:
- The mirror specification for the repository or
nullif no mirror matched.
-
injectMirror
Description copied from interface:RepositorySystemInjects 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 beforeRepositorySystem.injectAuthentication(List, List)or the repositories will end up with the wrong credentials.- Specified by:
injectMirrorin interfaceRepositorySystem- Parameters:
repositories- The repositories into which to inject the mirror information, may benull.mirrors- The available mirrors, may benull.
-
injectMirror
public void injectMirror(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) - Specified by:
injectMirrorin interfaceRepositorySystem
-
injectAuthentication
Description copied from interface:RepositorySystemInjects 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 afterRepositorySystem.injectMirror(List, List)or the repositories will end up with the wrong credentials.- Specified by:
injectAuthenticationin interfaceRepositorySystem- Parameters:
repositories- The repositories into which to inject the authentication information, may benull.servers- The available servers, may benull.
-
injectAuthentication
public void injectAuthentication(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) - Specified by:
injectAuthenticationin interfaceRepositorySystem
-
injectProxy
Description copied from interface:RepositorySystemInjects 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 afterRepositorySystem.injectMirror(List, List)or the repositories will end up with the wrong proxies.- Specified by:
injectProxyin interfaceRepositorySystem- Parameters:
repositories- The repositories into which to inject the proxy information, may benull.proxies- The available proxies, may benull.
-
injectProxy
public void injectProxy(org.eclipse.aether.RepositorySystemSession session, List<ArtifactRepository> repositories) - Specified by:
injectProxyin interfaceRepositorySystem
-
retrieve
public void retrieve(ArtifactRepository repository, File destination, String remotePath, ArtifactTransferListener transferListener) throws ArtifactTransferFailedException, ArtifactDoesNotExistException - Specified by:
retrievein interfaceRepositorySystem- Throws:
ArtifactTransferFailedExceptionArtifactDoesNotExistException
-
publish
public void publish(ArtifactRepository repository, File source, String remotePath, ArtifactTransferListener transferListener) throws ArtifactTransferFailedException - Specified by:
publishin interfaceRepositorySystem- Throws:
ArtifactTransferFailedException
-
buildArtifactRepository
public ArtifactRepository buildArtifactRepository(Repository repo) throws InvalidRepositoryException - Specified by:
buildArtifactRepositoryin interfaceRepositorySystem- Throws:
InvalidRepositoryException
-
createArtifactRepository
public ArtifactRepository createArtifactRepository(String repositoryId, String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases) - Specified by:
createArtifactRepositoryin interfaceRepositorySystem
-