Appearance
Immutability
A released version is a promise: the bytes that a build resolved yesterday are the bytes it resolves today. Artifex keeps that promise by refusing to overwrite a file that exists.
Releases can't be replaced
By default, deploying a path that already holds a file is refused with 409 Conflict and the message This release file already exists. Releases can't be replaced. Nothing is changed.
Deleting is also refused by default. A DELETE request from a Maven client answers 403 Forbidden.
A build that wants to publish again has to publish a new version. That's the behavior you want for anything that other people resolve.
Allow replacing files
Some repositories aren't published to other people, such as a scratch repository or one that a pipeline rebuilds. For those, an administrator can turn replacement on.
To allow replacing files, follow these steps:
- Open the repository and go to Settings.
- Turn on Allow replacing files.
- Click Save changes.
Deploying an existing path then answers 200 OK instead of 201 Created, and the new bytes are served from that point on. The activity records the event as a replacement and keeps the digest of the file that was there before.
Allow deleting files
To allow deleting, follow these steps:
- Open the repository and go to Settings.
- Turn on Allow deleting files.
- Click Save changes.
DELETE from a Maven client then answers 204 No Content, and the file stops being served. The file and version pages also offer deletion.
Snapshots are different
A snapshot version holds many builds, and each deploy adds one. Deploying the same build twice is still a conflict, because that build already exists. For more information, see Snapshots.