不同环境的Maven war/jar文件版本

发布于 2024-12-29 01:16:06 字数 190 浏览 2 评论 0原文

我们使用 Maven 作为我们的构建工具。目前我们有 DEV、TEST、QA 环境。 我们的应用程序使用 JSF 框架。

在不同环境中对应用程序 Jars、通用模块 Jars 进行版本控制的最佳实践是什么。 DEV - D-0.1-快照
测试 - T-0.1-快照 QA - QA-0.1-快照

谢谢 维杰

We are using Maven as our build tool. Currently we have DEV , TEST , QA environments.
Our application is using JSF framework.

What is the best practice to version the Application Jars ,Common module Jars in different environments.
DEV - D-0.1-Snapshots
TEST - T-0.1-Snapshots
QA - QA-0.1-Snapshots

Thanks
Vijay

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

扮仙女 2025-01-05 01:16:06

如果您设置为不同的环境使用不同的工件(可能不是最好的主意),您可以通过使用不同的配置文件生成不同的版本,并让 maven-compiler-plugin 对每个环境使用一个分类器。不确定我会走这条路,但如果必须的话,你可能会这样做。

If you are set on having different artifacts for different environments (probably not the best idea), you could generate different versions by using different profiles, and have the maven-compiler-plugin use a classifier for each environment. Not sure I'd go this route, but if you have to, you could potentially do that.

_蜘蛛 2025-01-05 01:16:06

通常,库不会标有环境名称。原因是您可能希望在每个环境中逐步推广相同的版本,直到它们上线。所以你可以有:

  • 开发中的项目 1.3
  • 测试中的项目 1.2 测试中的
  • 项目 1.1
  • 生产中的项目 1.0

Quite often the libraries aren't labelled with the environment name. The reason for this is that you probably want to gradually promote the same version through each of your environments until they are live. So you could have:

  • project-1.3 in development
  • project-1.2 in test
  • project-1.1 in qa
  • project-1.0 in production
请帮我爱他 2025-01-05 01:16:06

@Michaels 使用分类器的想法是可行的方法。
请参阅 http://maven.apache.org/guides/ mini/guide-building-for- different-environments.html

当查看最终工件时,名称应该告诉您 3 个主要事实 (myApp-1.2-prod):

  1. 应用程序名称:myApp
  2. 应用程序版本: 1.2
  3. 应用程序配置:prod(这是分类器)

过去我也使用过程序集 来打包不同的工件配置。

@Michaels idea of using a classifier is the way to go.
See http://maven.apache.org/guides/mini/guide-building-for-different-environments.html

When looking at the final artifact, the name should tell you 3 main facts (myApp-1.2-prod) :

  1. Application name : myApp
  2. Application version : 1.2
  3. Application configuration : prod (this is the classifier)

In the past I've also used assemblies to package the different artifact configurations.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文