public class CleanupReleasedSnapshotsRepositoryPurge extends AbstractRepositoryPurge
This will look in a single managed repository, and purge any snapshots that are present that have a corresponding released version on the same repository.
So, if you have the following (presented in the m2/default layout form) ...
/com/foo/foo-tool/1.0-SNAPSHOT/foo-tool-1.0-SNAPSHOT.jar /com/foo/foo-tool/1.1-SNAPSHOT/foo-tool-1.1-SNAPSHOT.jar /com/foo/foo-tool/1.2.1-SNAPSHOT/foo-tool-1.2.1-SNAPSHOT.jar /com/foo/foo-tool/1.2.1/foo-tool-1.2.1.jar /com/foo/foo-tool/2.0-SNAPSHOT/foo-tool-2.0-SNAPSHOT.jar /com/foo/foo-tool/2.0/foo-tool-2.0.jar /com/foo/foo-tool/2.1-SNAPSHOT/foo-tool-2.1-SNAPSHOT.jarthen the current highest ranked released (non-snapshot) version is 2.0, which means the snapshots from 1.0-SNAPSHOT, 1.1-SNAPSHOT, 1.2.1-SNAPSHOT, and 2.0-SNAPSHOT can be purged. Leaving 2.1-SNAPSHOT in alone.
AbstractRepositoryPurge.ArtifactInfo
Modifier and Type | Field and Description |
---|---|
private ManagedRepositoryAdmin |
managedRepositoryAdmin |
private MetadataTools |
metadataTools |
private RepositoryContentFactory |
repoContentFactory |
listeners, log, repository, repositorySession
Constructor and Description |
---|
CleanupReleasedSnapshotsRepositoryPurge(ManagedRepositoryContent repository,
MetadataTools metadataTools,
ManagedRepositoryAdmin managedRepositoryAdmin,
RepositoryContentFactory repoContentFactory,
RepositorySession repositorySession,
List<RepositoryListener> listeners) |
Modifier and Type | Method and Description |
---|---|
void |
process(String path)
Perform checking on artifact for repository purge
|
private void |
updateMetadata(ArtifactReference artifact) |
deleteArtifactFiles, purge
private MetadataTools metadataTools
private ManagedRepositoryAdmin managedRepositoryAdmin
private RepositoryContentFactory repoContentFactory
public CleanupReleasedSnapshotsRepositoryPurge(ManagedRepositoryContent repository, MetadataTools metadataTools, ManagedRepositoryAdmin managedRepositoryAdmin, RepositoryContentFactory repoContentFactory, RepositorySession repositorySession, List<RepositoryListener> listeners)
public void process(String path) throws RepositoryPurgeException
RepositoryPurge
path
- path to the scanned artifactRepositoryPurgeException
private void updateMetadata(ArtifactReference artifact)
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.