maven:如何清理本地仓库中的旧快照?

maven: how to clean the old snapshot in local repo?

我在我的 pom.xml 中使用了另一个 team.After 开发的快照 jar 一段时间,我在我的本地 repo 中发现了很多带有时间戳的快照 jar,例如 bellows:

base-0.0.1-20190924.065706-10.jar base-0.0.1-20190925.002128-11.jar base-0.0.1-20191107.012927-66.jar base-0.0.1-20191108.002149-68.jar

我知道我可以手动清除它们,但我想一定有办法自动清除它们? 有人知道吗?

mvn dependency:purge-local-repository 可能会有帮助。查看有关包含特定 groupId 或 artifactId 的部分。

https://maven.apache.org/plugins/maven-dependency-plugin/examples/purging-local-repository.html