Package org.apache.maven.repository
Interface RepositorySystem
-
- All Known Implementing Classes:
LegacyRepositorySystem
public interface RepositorySystem- Since:
- 3.0-alpha
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_LOCAL_REPO_IDstatic java.lang.StringDEFAULT_REMOTE_REPO_IDstatic java.lang.StringDEFAULT_REMOTE_REPO_URLstatic java.io.FiledefaultUserLocalRepositorystatic java.lang.StringuserHomestatic java.io.FileuserMavenConfigurationHome
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ArtifactRepositorybuildArtifactRepository(Repository repository)ArtifactcreateArtifact(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String packaging)ArtifactcreateArtifact(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String scope, java.lang.String type)ArtifactRepositorycreateArtifactRepository(java.lang.String id, java.lang.String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases)ArtifactcreateArtifactWithClassifier(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, java.lang.String classifier)ArtifactRepositorycreateDefaultLocalRepository()ArtifactRepositorycreateDefaultRemoteRepository()ArtifactcreateDependencyArtifact(Dependency dependency)ArtifactRepositorycreateLocalRepository(java.io.File localRepository)ArtifactcreatePluginArtifact(Plugin plugin)ArtifactcreateProjectArtifact(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)java.util.List<ArtifactRepository>getEffectiveRepositories(java.util.List<ArtifactRepository> repositories)Calculates the effective repositories for the given input repositories which are assumed to be already mirrored (if applicable).MirrorgetMirror(ArtifactRepository repository, java.util.List<Mirror> mirrors)Determines the mirror for the specified repository.voidinjectAuthentication(java.util.List<ArtifactRepository> repositories, java.util.List<Server> servers)Injects the authentication information into the specified repositories.voidinjectAuthentication(org.eclipse.aether.RepositorySystemSession session, java.util.List<ArtifactRepository> repositories)voidinjectMirror(java.util.List<ArtifactRepository> repositories, java.util.List<Mirror> mirrors)Injects the mirroring information into the specified repositories.voidinjectMirror(org.eclipse.aether.RepositorySystemSession session, java.util.List<ArtifactRepository> repositories)voidinjectProxy(java.util.List<ArtifactRepository> repositories, java.util.List<Proxy> proxies)Injects the proxy information into the specified repositories.voidinjectProxy(org.eclipse.aether.RepositorySystemSession session, java.util.List<ArtifactRepository> repositories)voidpublish(ArtifactRepository repository, java.io.File source, java.lang.String remotePath, ArtifactTransferListener transferListener)ArtifactResolutionResultresolve(ArtifactResolutionRequest request)voidretrieve(ArtifactRepository repository, java.io.File destination, java.lang.String remotePath, ArtifactTransferListener transferListener)
-
-
-
Field Detail
-
DEFAULT_LOCAL_REPO_ID
static final java.lang.String DEFAULT_LOCAL_REPO_ID
- See Also:
- Constant Field Values
-
userHome
static final java.lang.String userHome
-
userMavenConfigurationHome
static final java.io.File userMavenConfigurationHome
-
defaultUserLocalRepository
static final java.io.File defaultUserLocalRepository
-
DEFAULT_REMOTE_REPO_ID
static final java.lang.String DEFAULT_REMOTE_REPO_ID
- See Also:
- Constant Field Values
-
DEFAULT_REMOTE_REPO_URL
static final java.lang.String DEFAULT_REMOTE_REPO_URL
- See Also:
- Constant Field Values
-
-
Method Detail
-
createArtifact
Artifact createArtifact(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String packaging)
-
createArtifact
Artifact createArtifact(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String scope, java.lang.String type)
-
createProjectArtifact
Artifact createProjectArtifact(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
-
createArtifactWithClassifier
Artifact createArtifactWithClassifier(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, java.lang.String classifier)
-
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(java.io.File localRepository) throws InvalidRepositoryException
- Throws:
InvalidRepositoryException
-
createArtifactRepository
ArtifactRepository createArtifactRepository(java.lang.String id, java.lang.String url, ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryPolicy snapshots, ArtifactRepositoryPolicy releases)
-
getEffectiveRepositories
java.util.List<ArtifactRepository> getEffectiveRepositories(java.util.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 benull.- Returns:
- The effective repositories or
nullif the input wasnull.
-
getMirror
Mirror getMirror(ArtifactRepository repository, java.util.List<Mirror> mirrors)
Determines the mirror for the specified repository.- 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
void injectMirror(java.util.List<ArtifactRepository> repositories, java.util.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 beforeinjectAuthentication(List, List)or the repositories will end up with the wrong credentials.- Parameters:
repositories- The repositories into which to inject the mirror information, may benull.mirrors- The available mirrors, may benull.
-
injectProxy
void injectProxy(java.util.List<ArtifactRepository> repositories, java.util.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 afterinjectMirror(List, List)or the repositories will end up with the wrong proxies.- Parameters:
repositories- The repositories into which to inject the proxy information, may benull.proxies- The available proxies, may benull.
-
injectAuthentication
void injectAuthentication(java.util.List<ArtifactRepository> repositories, java.util.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 afterinjectMirror(List, List)or the repositories will end up with the wrong credentials.- Parameters:
repositories- The repositories into which to inject the authentication information, may benull.servers- The available servers, may benull.
-
injectMirror
void injectMirror(org.eclipse.aether.RepositorySystemSession session, java.util.List<ArtifactRepository> repositories)
-
injectProxy
void injectProxy(org.eclipse.aether.RepositorySystemSession session, java.util.List<ArtifactRepository> repositories)
-
injectAuthentication
void injectAuthentication(org.eclipse.aether.RepositorySystemSession session, java.util.List<ArtifactRepository> repositories)
-
resolve
ArtifactResolutionResult resolve(ArtifactResolutionRequest request)
-
publish
void publish(ArtifactRepository repository, java.io.File source, java.lang.String remotePath, ArtifactTransferListener transferListener) throws ArtifactTransferFailedException
- Throws:
ArtifactTransferFailedException
-
retrieve
void retrieve(ArtifactRepository repository, java.io.File destination, java.lang.String remotePath, ArtifactTransferListener transferListener) throws ArtifactTransferFailedException, ArtifactDoesNotExistException
-
-