简体   繁体   English

有没有办法取消部署Maven快照?

[英]Is there a way to undeploy a maven snapshot?

I have some snapshots in a maven snapshot repo that I wish to completely delete. 我希望完全删除Maven快照存储库中的一些快照。 I want to delete these artifacts so that team members will be unable to resolve them if they attempt to continue to use them (they were moved to a new group). 我想删除这些工件,以便团队成员在尝试继续使用它们时将无法解决它们(他们已移至新的组)。 Is there a way I can undeploy them from mvn or is this a task that only an admin of the mvn snapshot repo can take care of? 有什么办法可以从mvn取消部署它们,还是只有mvn快照存储库的管理员才能完成的任务?

While you can delete it from your server, you can't really stop them from using it; 尽管可以从服务器中删除它,但不能真正阻止他们使用它。 if they have a local copy they will continue to resolve it. 如果他们有本地副本,他们将继续解决。 You don't really want to block them either - the whole point of maven is a declarative representation of what to use. 您实际上也不想阻止它们-Maven的要点是所使用内容的声明性表示。 If they want to build a legacy version of their code for whatever reason (testing, reproducibility, roll-back,...), this would likely block that. 如果他们出于某种原因(测试,可再现性,回滚...)而希望构建其代码的旧版本,则可能会阻止该行为。

You could push a new snapshot and flag all the code as deprecated so their complier complains (assuming they update). 您可以推送一个新的快照,并将所有代码标记为已弃用,以便其编译器抱怨(假设它们已更新)。

Now for new projects or updating existing ones we use a common parent POM that uses a dependency management section so that keeps things in pretty good shape. 现在,对于新项目或更新现有项目,我们使用一个公共的父POM,该POM使用一个依赖项管理部分,以使事情保持良好状态。 But you have to make sure they stick with your parent pom. 但是您必须确保它们坚持使用您的父pom。

Others have done some work with the enforcer plugin. 其他人则通过执行器插件做了一些工作。

It seems people have been talking about this for years here: 似乎人们多年来一直在这里谈论这个问题:

https://jira.codehaus.org/browse/MNG-3952 https://jira.codehaus.org/browse/MNG-3952

and here: 和这里:

http://maven.40175.n5.nabble.com/Deprecating-and-banning-artifacts-with-repository-metadata-td124274.html http://maven.40175.n5.nabble.com/Deprecating-and-banning-artifacts-with-repository-metadata-td124274.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM