如何在 SBT 中声明对 jboss 的依赖?
我有一个依赖于 JBoss(特别是 5.1.0.GA)的项目,我正在尝试使用 SBT 设置该项目。我想知道是否有一种方法可以说“这个项目依赖于 JBoss 版本 X 以及与之相关的所有内容”,或者我是否必须单独声明每个依赖项?我希望 SBT 随后能够下载编译该项目所需的所有适当的依赖项。
我对依赖管理还很陌生,所以任何方向都会受到赞赏。我正在尝试使用 SBT(使用 Ivy)来做到这一点,但也欢迎使用 Maven 中的示例。
I have a project that depends on JBoss(specifically 5.1.0.GA) and I was playing around with trying to set this project up using SBT. What I was wondering is if there is a way to say "this project depends on JBoss version X and everything that goes with it" or do I have do declare every single dependency individually? My hope is that SBT will then download all the appropriate dependencies needed to compile the project.
I am pretty new to dependency management so any direction is appreciated. I am trying to do this using SBT (which uses Ivy) but an example in maven is also welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须手动声明每个依赖项,没有包含所有依赖项的超级 pom。
这通常非常棘手,因为在某些情况下很难找出您到底需要什么。
一个好的开始是获取 jboss_home/lib 下的每个库,并从那里开始减少。
如果您有自己的存储库代理(例如artifactory或archiva),您可以创建这样的超级pom。
这是来自我自己的存储库,可能会帮助您入门。但这绝不是官方的,也不符合我的需要。
You have to declare every dependency manually, there is no super-pom, that includes all dependencies.
This is mostly very tricky, because it is hard to find out, what you need exactly in some cases.
A good start is to take every lib, that is also under jboss_home/lib and start reducing from there.
If you have your own repository proxy (like artifactory or archiva), you could create such a super pom.
This is from my own repository and might help getting you started. But this is in no way official and fitted to my needs.