首页 > 解决方案 > 如何使用 java 在 sonatype nexus3 中删除未使用的工件并重建索引?

问题描述

当我从 Nexus3 存储库中删除工件时,很少有清单文件仍在存储库中待处理。这些并没有从nexus3中完全删除。但是,我得到的建议很少是“重建索引”。

如何重建索引,以便我可以显示所有已删除的指定工件?

我曾尝试使用这个库从 nexus 中删除工件repos.com.github.dockerjava.api.command.RemoveImageCmd。但是,正在从该库中删除工件,但其中很少有像清单文件一样保留下来。

RemoveImageCmd removeImageCmd = client.removeImageCmd(imageFullName).withForce(true);
            removeImageCmd.exec();

我希望输出与清单文件一起删除了 nexus 存储库中的所有工件。

标签: javaindexingsonatypenexus3rebuild

解决方案


我可以从nexus repo中删除其他文件,例如json,txt,zip文件,但是我无法删除以下错误日志:

2019-09-18T23:16:21.880Z http-nio-8083-exec-9 错误 org.acumos.portal.be.controller.MarketPlaceCatalogServiceController 用户=Xmen,X-ACUMOS-Request-Id=51ed823b-474a-4449-b6e4 -1c4c3fc40a1e,ClientIPAddress=XYZ.24.0.4,ServerFQDN=acumos-portal-be AcumosServiceException 在 deleteSolutionArtifacts() org.acumos.portal.be.common.exception.AcumosServiceException 时发生:404 nexusRepoURL:8081/repository/acumos-dev-docker /v2/vt_delete_2_webcrosssellanalytics_adae47d5-7249-4bdf-b1f8-fe4a6343e36b/manifests/1

我的 nexus 存储库的清单文件路径是: http://nexusRepoURL:8081/repository/acumos-dev-docker/v2/vt_delete_2_webcrosssellanalytics_adae47d5-7249-4bdf-b1f8-fe4a6343e36b/manifests/1


推荐阅读