罐子包装和分销 [英] Jar packaging and distribution

查看:120
本文介绍了罐子包装和分销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在包中按预期布置了一些通用代码。
其中一些包是
处理程序,处理器,工具,注册

We have some common code laid out in packages as expected. Some of these packages are handler, processor, util, registration etc

Common 这里意味着这些将在多个Java / Java EE项目中重复使用,它们彼此无关。

Common here means these will be re-used across multiple Java / Java EE projects which are unrelated to each other.

问题在于分发包装。

每个包装包含不同的功能单元,但放在一起,它们是API。

Each package comprises a different functional units but put together, they are an API.

我们是否应该将个别功能捆绑到JAR中,最后说8到10个罐子。
例如:处理程序jar,注册jar等

Should we bundle individual functionalities into a JAR and end up with say 8 - 10 jars. eg: handler jar, registration jar etc

我们应该采用最小公分母方法是将5个强制包装的基础构建成一个罐子。
任何其他人都需要该jar作为基础,并且可以选择附加jar。

Should we take the least common denominator approach which is a Base Build of 5 compulsory packages into a single jar. Any one else needs that jar as the base and can choose add-on jars.

我们的构建系统是Ant + Ivy,这些依赖关系将在编译和构建时间。

Our build system is Ant + Ivy and these dependencies will be resolved at compile and build time.

推荐答案

除非你有很多很多的API类(想想Spring)或者意识到它们之间存在一些干扰我认为,没有理由把它们分成不同的罐子。在单独的jar中打破API的唯一另一个原因是让不同的团队能够独立工作。

Unless you have lots and lots of API classes (think Spring) or aware of some interference among them, it is my opinion, that there is very little reason to break them into separate jars. The only other reason to break API in separate jars is to enable different teams work independently.

管理单个jar简化了很多事情并且不值得解决这个问题不存在。

Managing single jar simplifies a lot of things and it does not worth fixing the problem that does not exist.

这篇关于罐子包装和分销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆