进行持续交付时,自动项目版本的 Maven 方式是什么?

我有一个 Web 应用程序,只要功能准备就绪,我们就会将其部署到生产环境中,有时可能是一天几次,有时可能是发布之间的几周.

I have a web application where we deploy to production whenever a feature is ready, sometimes that can be a couple of times a day, sometimes it can be a couple of weeks between releases.

目前,我们不会为我们的项目增加版本号,并且所有内容都在版本 0.0.1-SNAPSHOT 上运行了一年多.我想知道为 Web 应用程序进行持续交付的 Maven 方式是什么.每次提交都增加版本号似乎有点过头了,而且永远不要像我们现在做的那样增加版本号,这似乎也是错误的.

Currently, we don't increment our version numbers for our project, and everything has been sitting at version 0.0.1-SNAPSHOT for well over a year. I am wondering what is the Maven way for doing continuous delivery for a web apps. It seems overkill to bump up the version number on every commit, and never bumping the version number like we are doing now, also seems wrong.

对于这种类型的 Maven 使用,推荐的最佳做法是什么?

这个问题其实有两个方面:

The problem is actually a two-fold one:

  • 在单个 pom.xml 文件中推进项目版本号(可以有很多).
  • 更新所有依赖组件中的版本号以使用彼此的最新版本.
  • Advancing project version number in individual pom.xml file (and there can be many).
  • Updating version number in all dependent components to use latest ones of each other.

推荐答案

我推荐以下演示文稿,讨论使用 Maven 进行持续交付的实际现实:

I recommend the following presentation that discusses the practical realities of doing continuous delivery with Maven:

  • 您使用 Maven 在 CD 上进行电子管演示
  • 幻灯片

关键点是每个构建都是一个潜在的版本,所以不要使用快照.

The key takeaway is each build is a potential release, so don't use snapshots.

相关文章