Immutability
A Maven release version is immutable: the bytes that a build resolved yesterday are the bytes that it resolves today. Artifex preserves that behavior by refusing to overwrite an existing file.
Releases can't be replaced
By default, redeploying a file that already exists fails, and the build reports that the release file already exists and can't be replaced. Deleting is also refused by default.
To publish again, publish a different version.
Allow replacing files
Some repositories have no consumers outside your own builds, such as a scratch repository or one that a CI pipeline rebuilds. For those repositories, a person with the Admin repository role can allow replacement.
To allow replacing files, follow these steps:
- Open the repository and go to Settings.
- Turn on Allow replacing files.
- Click Save changes.
Redeploying an existing file then replaces it. The activity records the event as a replacement and shows the file that it replaced.
Allow deleting files
To allow deleting files, follow these steps:
- Open the repository and go to Settings.
- Turn on Allow deleting files.
- Click Save changes.
People with the Write or Admin repository role can then delete files and versions from the file and version pages. Build tools can also delete files.
Snapshots are different
A snapshot version can contain multiple timestamped snapshots, and each publication adds one. Deploying the same timestamped snapshot twice still fails because that timestamped snapshot already exists. For more information, see Snapshots.
Advanced
A redeployment over an existing release file responds 409 Conflict with the message This release file already exists. Releases can't be replaced. With Allow replacing files on, it responds 200 OK instead of 201 Created.
A DELETE request responds 403 Forbidden unless Allow deleting files is on. When the setting is on, the request responds 204 No Content.