在 SVN 中存储二进制文件是否可以接受/好? [英] Is it acceptable/good to store binaries in SVN?
问题描述
我们想共享运行时项目二进制文件.所以每个团队成员都可以使用当前的工作版本.在 SVN 中存储运行时二进制文件是否可以接受/很好?
We would like to share runtime project binary files. So every team member could take current working version. It is acceptable/good to store runtime binaries in the SVN?
推荐答案
您可能希望在版本控制系统中存储二进制文件的两个常见原因是(编写于 2009 年):
The two common reasons you may want to store binaries in a Version Control System are (written in 2009):
- 存储外部第三方库.
通常将它们存储到 Maven 存储库中,但将它们存储到 SVN 允许您拥有一个且只有一个引用来满足您的所有需求:获取源代码,并获取您的编译这些源代码所需的库.全部来自一个存储库.
(正如 ivorujavaboy 在 2017 年指出的那样:目前这样做的唯一充分理由是,如果您有永远不会改变的静态库,这种情况非常罕见")
(As noted by ivorujavaboy in 2017: "The only good reason to do this at present day is if you have STATIC libraries that will never change, which is a really rare case")
- 商店交付以加快部署.
通常交付(您构建以部署到生产中的可执行文件)是按需构建的.
但是,如果您有许多预生产环境,并且如果您有许多交付,那么为组装、集成、认证、预生产平台构建它们的成本可能很高.
一种解决方案是构建一次,将它们存储在 SVN 的交付部分,然后直接在不同的环境中使用它们.
注意:
这也适用于开发元素:如果您有一个 Jaxb 进程,它会生成 900 个 POJO 文件(通过 XML 绑定),并且您需要在多个环境中下载该开发集,您可能需要 1 个压缩文件复制事务,而不是 900 个.
- store deliveries for quicker deployment.
Usually deliveries (the executable you build to deploy into production) are built on demand.
But if you have many pre-production environment, and if you have many deliveries, the cost of building them for assembly, integration, homologation, pre-production platforms can be high.
A solution is to build them once, store them in a deliveries section of your SVN, and use them directly in your different environment.
Note:
This apply also to development elements: if you have a Jaxb process which generates 900 POJO files (through XML binding), and you need to download that development set in multiple environments, you may want 1 compressed file copy transaction, rather than 900 ones.
所以,是的,出于正确的原因,在 SVN 中存储运行时二进制文件是可以接受的/很好"....
So yes, it is "acceptable/good to store runtime binaries in the SVN"... for the right reasons.
话虽如此:
- Wim Coenen 理所当然地提到了缺点(不好的做法,速度慢,来源和存储交付之间不匹配)
- Vladimir 提倡使用交付引用(Nexus 或者,正如 Vladimir 提到的,Apache ivy)
- RogerV 说明了使用所述交付参考的优势(在他的案例中为 Nexus)
- Wim Coenen rightfully mentions the disadvantages (bad practice, slow, mismatch between sources and stored delivery)
- Vladimir advocates for the use of a delivery referential (Nexus or, as Vladimir mentions, Apache ivy)
- RogerV illustrates the advantages of using said delivery referential (Nexus in his case)
这篇关于在 SVN 中存储二进制文件是否可以接受/好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!