为什么Maven发行插件在依赖项管理中允许SNAPSHOT版本? [英] Why does maven release plugin allow for SNAPSHOT version in dependency management?

查看:445
本文介绍了为什么Maven发行插件在依赖项管理中允许SNAPSHOT版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有1个公司母pom.这将使用dependencyManagement来管理所使用的所有工件的所有依赖项的版本.

We have 1 company parent pom. This uses dependencyManagement to manage the versions for all the dependencies of all the artifacts used.

令人震惊的是,可以在dependencyManagement中定义SNAPSHOT版本.尽管执行maven释放后,仍可以在dependencyManagement中以SNAPSHOT版本释放pom.为什么?

What is alarming, is that SNAPSHOT versions can be defined in dependencyManagement. Though when maven release is performed, the pom is allowed to be released with SNAPSHOT version in dependencyManagement. Why?

如果我将子项目指向公司父pom的发行版,并且该子项目使用的是SNAPSHOT版本,则该子项目使用的是dependencyManagement中定义的依赖项,那么我将无法释放该子项目.

If I point a child project to a released version of the company parent pom, and this child project uses a dependency defined in dependencyManagement though it's a SNAPSHOT version, I'm unable to release the child project.

为什么Maven允许发布SNAPSHOT版本以发布在dependencyManagement中定义的工件?如果定义了SNAPSHOT版本,如何配置Maven发布插件失败?

Why does Maven allow SNAPSHOT version for an artifact defined in dependencyManagement to be released? And how can I configure the maven release plugin to fail if there is a SNAPSHOT version defined?

推荐答案

令人震惊的是,可以在dependencyManagement中定义SNAPSHOT版本.尽管执行maven释放后,仍可以在dependencyManagement中以SNAPSHOT版本释放pom.为什么?

What is alarming, is that SNAPSHOT versions can be defined in dependencyManagement. Though when maven release is performed, the pom is allowed to be released with SNAPSHOT version in dependencyManagement. Why?

我希望 maven-release-plugin 更新SNAPSHOT发布时dependencyManagement中的版本.实际上,对此有一些Jira,例如 MRELEASE-91 MRELEASE-202 可能会影响您.

I would expect the maven-release-plugin to update SNAPSHOT versions in dependencyManagement upon release. Actually, there are some Jira about this, for example MRELEASE-91 and MRELEASE-202 that may affect you.

问题是:您使用的是哪个版本的插件?

So the question is: which version of the plugin are you using?

但是,说实话, MRELEASE-202

But to be honest, it's not really clear what versions are affected by MRELEASE-202, the comments are confusing (so I wonder if the issue is fixed or not). Anyway, if the version you are using is affected, then upgrade to a more recent version. And if the bug/regression (I think it's a bug) is still there, then raise a new issue.

这篇关于为什么Maven发行插件在依赖项管理中允许SNAPSHOT版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆