GoogleCloudPlatform / GoogleCloudPlatform/cloud-opensource-java

JLBP and Vendoring

未关闭
#1,136 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
best practices p2
主要语言
Java
星标
163
派生
80
PR 合并指标
30 天内没有已合并 PR

描述

JLBP-18 only discusses shading. Consider what, if anything, to say about "vendoring" as used by the Beam project. Per Aaron Dixon on the beam developer list:

> With SHADING you have your project (e.g., Beam) depend directly on Guava and its public package names. Your build will then compile and link to these package names and only after-the-fact [1] rewrite the byte-code to rename the guava package. This entails both byte-code rewriting the Guava class files (to rename the packages of the Guava code itself) and byte-code rewriting all of your project class files that import Guava (to change the import to use the new package name).
> With VENDORING you release a renamed Guava ("vendor") JAR and depend on that directly from your project. So your project's source code itself imports the (repackaged) vendor JAR and depends on the renamed packages directly. Your project build then has no need for shading or byte code rewriting of its own classes. I see vendoring making it very clear what is going on when looking at a project's source code and its dependencies, and there are likely other tangible brass-tacks benefits to vendoring besides the conceptual clarity over shading.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。