Package org.apache.maven.api.services
Interface LocalRepositoryManager
- All Superinterfaces:
Service
- All Known Implementing Classes:
DefaultLocalRepositoryManager
Manages the organization and access of artifacts within the local Maven repository.
The local repository serves as a cache for downloaded remote artifacts and storage
for locally installed artifacts. This manager provides services to determine the
appropriate paths for artifacts within the local repository structure.
The LocalRepositoryManager is responsible for:
- Determining the storage path for locally installed artifacts
- Managing the layout and organization of cached remote artifacts
- Maintaining consistency in artifact storage patterns
This interface is part of Maven's repository management system and works in
conjunction with RemoteRepository
and LocalRepository
to provide
a complete artifact resolution and storage solution.
- Since:
- 4.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetPathForLocalArtifact
(Session session, LocalRepository local, Artifact artifact) Gets the relative path for a locally installed artifact.getPathForRemoteArtifact
(Session session, LocalRepository local, RemoteRepository remote, Artifact artifact) Gets the relative path for an artifact cached from a remote repository.
-
Method Details
-
getPathForLocalArtifact
@Nonnull Path getPathForLocalArtifact(@Nonnull Session session, @Nonnull LocalRepository local, @Nonnull Artifact artifact) Gets the relative path for a locally installed artifact. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored.- Parameters:
session
- The session to use, must not benull
.artifact
- The artifact for which to determine the path, must not benull
.- Returns:
- The path, resolved against the local repository's base directory.
-
getPathForRemoteArtifact
@Nonnull Path getPathForRemoteArtifact(@Nonnull Session session, @Nonnull LocalRepository local, @Nonnull RemoteRepository remote, @Nonnull Artifact artifact) Gets the relative path for an artifact cached from a remote repository. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored.- Parameters:
session
- The session to use, must not benull
.local
- The local repository, must not benull
.artifact
- The artifact for which to determine the path, must not benull
.remote
- – The source repository of the artifact, must not benull
.- Returns:
- The path, relative to the local repository's base directory.
-