如何防止以前部署的工件被覆盖?

问题描述:

我们将Artifactory用于我们公司的Maven存储库.有没有一种方法可以设置它(或设置Maven),以便在存在相同版本号的工件时不能将其部署到存储库中?

We use Artifactory for our company's Maven repository. Is there a way to set it up (or set Maven up) so that an artifact can't be deployed to the repository if there is a pre-existing artifact with the same version number?

这样做的原因是要确保有效的发行版本不会意外被覆盖.如果确实需要重新部署工件,那么我们的开发人员之一可以使用Artifactory Web界面将其删除.然后他们可以部署新副本.

The reasoning for this is to make sure that valid releases don't accidentally get overwritten. If an artifact really does need to be re-deployed, one of our developers can use the Artifactory web interface to delete it. Then they can deploy the new copy.

谢谢!

这很容易通过从目标存储库上的部署用户\组中撤消删除"权限来实现.删除工件和重新部署工件都需要具有删除权限.

This is easily achieved by revoking the "Delete" permission from the deploying users\groups on the target repository; the delete permission is required for both artifact removal and artifact re-deployment.

所有用户\组权限都可以在用户界面的 Admin-> Security-> Permissions 中进行编辑.
另请参见管理权限

All user\group permissions are editable within the UI at Admin->Security->Permissions.
Also see Managing Permissions