不同环境的Maven war/jar文件版本
我们使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您设置为不同的环境使用不同的工件(可能不是最好的主意),您可以通过使用不同的配置文件生成不同的版本,并让 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.
通常,库不会标有环境名称。原因是您可能希望在每个环境中逐步推广相同的版本,直到它们上线。所以你可以有:
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:
@Michaels 使用分类器的想法是可行的方法。
请参阅 http://maven.apache.org/guides/ mini/guide-building-for- different-environments.html
当查看最终工件时,名称应该告诉您 3 个主要事实 (myApp-1.2-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) :
In the past I've also used assemblies to package the different artifact configurations.