class EnhancedLocalRepositoryManager extends SimpleLocalRepositoryManager
_remote.repositories, with content key as filename>repo_id and value as empty string. If a file has
been installed in the repository, but not downloaded from a remote repository, it is tracked as empty repository id
and always resolved. For example:
artifact-1.0.pom>= artifact-1.0.jar>= artifact-1.0.pom>central= artifact-1.0.jar>central= artifact-1.0.zip>central= artifact-1.0-classifier.zip>central= artifact-1.0.pom>my_repo_id=
EnhancedLocalRepositoryManagerFactory| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
LOCAL_REPO_ID |
private LocalPathPrefixComposer |
localPathPrefixComposer |
private TrackingFileManager |
trackingFileManager |
private java.lang.String |
trackingFilename |
| Constructor and Description |
|---|
EnhancedLocalRepositoryManager(java.io.File basedir,
LocalPathComposer localPathComposer,
java.lang.String trackingFilename,
TrackingFileManager trackingFileManager,
LocalPathPrefixComposer localPathPrefixComposer) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(RepositorySystemSession session,
LocalArtifactRegistration request)
Registers an installed or resolved artifact with the local repository.
|
private void |
addArtifact(Artifact artifact,
java.util.Collection<java.lang.String> repositories,
RemoteRepository repository,
java.lang.String context) |
private void |
addRepo(java.io.File artifactFile,
java.util.Collection<java.lang.String> repositories) |
private void |
checkFind(java.io.File file,
LocalArtifactResult result) |
private java.lang.String |
concatPaths(java.lang.String prefix,
java.lang.String artifactPath) |
LocalArtifactResult |
find(RepositorySystemSession session,
LocalArtifactRequest request)
Queries for the existence of an artifact in the local repository.
|
private java.lang.String |
getKey(java.io.File file,
java.lang.String repository) |
java.lang.String |
getPathForLocalArtifact(Artifact artifact)
Gets the relative path for a locally installed artifact.
|
java.lang.String |
getPathForLocalMetadata(Metadata metadata)
Gets the relative path for locally installed metadata.
|
java.lang.String |
getPathForRemoteArtifact(Artifact artifact,
RemoteRepository repository,
java.lang.String context)
Gets the relative path for an artifact cached from a remote repository.
|
java.lang.String |
getPathForRemoteMetadata(Metadata metadata,
RemoteRepository repository,
java.lang.String context)
Gets the relative path for metadata cached from a remote repository.
|
private java.util.Collection<java.lang.String> |
getRepositoryKeys(RemoteRepository repository,
java.util.Collection<java.lang.String> contexts) |
private java.io.File |
getTrackingFile(java.io.File artifactFile) |
private boolean |
isTracked(java.util.Properties props,
java.io.File file) |
private java.util.Properties |
readRepos(java.io.File artifactFile) |
add, find, getRepository, getRepositoryKey, toStringprivate static final java.lang.String LOCAL_REPO_ID
private final java.lang.String trackingFilename
private final TrackingFileManager trackingFileManager
private final LocalPathPrefixComposer localPathPrefixComposer
EnhancedLocalRepositoryManager(java.io.File basedir,
LocalPathComposer localPathComposer,
java.lang.String trackingFilename,
TrackingFileManager trackingFileManager,
LocalPathPrefixComposer localPathPrefixComposer)
private java.lang.String concatPaths(java.lang.String prefix,
java.lang.String artifactPath)
public java.lang.String getPathForLocalArtifact(Artifact artifact)
LocalRepositoryManagergetPathForLocalArtifact in interface LocalRepositoryManagergetPathForLocalArtifact in class SimpleLocalRepositoryManagerartifact - The artifact for which to determine the path, must not be null.public java.lang.String getPathForRemoteArtifact(Artifact artifact, RemoteRepository repository, java.lang.String context)
LocalRepositoryManagergetPathForRemoteArtifact in interface LocalRepositoryManagergetPathForRemoteArtifact in class SimpleLocalRepositoryManagerartifact - The artifact for which to determine the path, must not be null.repository - The source repository of the artifact, must not be null.context - The resolution context in which the artifact is being requested, may be null.public java.lang.String getPathForLocalMetadata(Metadata metadata)
LocalRepositoryManagergetPathForLocalMetadata in interface LocalRepositoryManagergetPathForLocalMetadata in class SimpleLocalRepositoryManagermetadata - The metadata for which to determine the path, must not be null.public java.lang.String getPathForRemoteMetadata(Metadata metadata, RemoteRepository repository, java.lang.String context)
LocalRepositoryManagergetPathForRemoteMetadata in interface LocalRepositoryManagergetPathForRemoteMetadata in class SimpleLocalRepositoryManagermetadata - The metadata for which to determine the path, must not be null.repository - The source repository of the metadata, must not be null.context - The resolution context in which the metadata is being requested, may be null.public LocalArtifactResult find(RepositorySystemSession session, LocalArtifactRequest request)
LocalRepositoryManagerfind in interface LocalRepositoryManagerfind in class SimpleLocalRepositoryManagersession - The repository system session during which the request is made, must not be null.request - The artifact request, must not be null.null.private void checkFind(java.io.File file,
LocalArtifactResult result)
public void add(RepositorySystemSession session, LocalArtifactRegistration request)
LocalRepositoryManageradd in interface LocalRepositoryManageradd in class SimpleLocalRepositoryManagersession - The repository system session during which the registration is made, must not be null.request - The registration request, must not be null.private java.util.Collection<java.lang.String> getRepositoryKeys(RemoteRepository repository, java.util.Collection<java.lang.String> contexts)
private void addArtifact(Artifact artifact, java.util.Collection<java.lang.String> repositories, RemoteRepository repository, java.lang.String context)
private java.util.Properties readRepos(java.io.File artifactFile)
private void addRepo(java.io.File artifactFile,
java.util.Collection<java.lang.String> repositories)
private java.io.File getTrackingFile(java.io.File artifactFile)
private java.lang.String getKey(java.io.File file,
java.lang.String repository)
private boolean isTracked(java.util.Properties props,
java.io.File file)