Help Center> CodeArts Artifact> User Guide> Self-hosted Repo (New Version)> Configuring the Artifact Cleanup Strategy
Updated on 2023-08-07 GMT+08:00

Configuring the Artifact Cleanup Strategy

You can automatically and manually delete artifacts that meet deletion conditions in batches. When a user creates a self-hosted Maven repo, the storage repositories include Release and Snapshot.

The snapshot of a Maven artifact is a special version that specifies a copy of the current development progress, and is different from a common version. Maven checks a new snapshot in the remote repository during each build and provides the maximum number of snapshot versions that can be retained and the function of automatically clearing expired snapshot versions.

The artifact cleanup strategy reduces the waste of storage space, makes artifacts in the repository clear, and ensures that artifacts are transferred in order during development, testing, deployment, and release.

Procedure

  1. Access the self-hosted repo by following instructions in Accessing Through a Specific Project.
  2. Select the corresponding Snapshot self-hosted Maven repo from the repository list on the left and click Settings in the upper right corner of the page.
  3. Click the Clearing Policies tab.

  4. Set the maximum number of Snapshot Count. The value ranges from 1 to 1000.

    When the version of an artifact package exceeds this value, the package of the earliest version is overwritten by the package of the latest version.

  5. Enable automatic cleanup (No by default). Click Yes and enter the number of days. Snapshot versions that have been stored for more than the specified number of days will be automatically cleaned up.

    The automatic cleanup time cannot be less than 1 day or greater than 100 days.

  6. Click Save to complete configuration.