- 登录Artifactory管理页面并选择“存储”选项卡。
- 找到存储库配置中的错误配置,并单击编辑。
- 取消勾选“Allow Content Redundancy”选项,这将禁止存储硬盘上的重复数据。
- 单击“保存”以保存更改。
- 如果需要,可以通过运行以下命令来清理重复的二进制文件:
curl -X POST -u : http:///api/storage/clean?repoKey=
(其中“Username”和“Password”是Artifactory管理员凭据,“Artifactory_URL”是Artifactory服务器URL,“Repository_Key”是Artifactory存储库密钥)
- 确认Artifactory现在正在正确配置以仅在一个地方存储二进制文件。
示例代码:
curl -X PUT -u : -H "Content-Type: application/json" -d '{
"enableTrace": false,
"key": "",
"allowContentRedundancy": false,
"blackedOut": false,
"handleReleases": true,
"handleSnapshots": true,
"maxUniqueSnapshots": -1,
"maxUniqueTags": -1,
"blockPushingSchema1": true,
"forceNugetAuthentication": false,
"nugetFeedVersion": "V2",
"suppressPomConsistencyChecks": false,
"debianTrivialLayout": false,
"calculateYumMetadata": true,
"yumRootDepth": 0
}' http:///artifactory/api/repositories/