Maven提供的范围可以传递吗? [英] Can Maven's provided scoping, be transitive?

查看:108
本文介绍了Maven提供的范围可以传递吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个祖先依赖关系依赖于所提供的范围,我需要将这个范围传播到依赖于我的项目的任何东西。 code> SomeProjectA ,这取决于 SomeLibraryB 。我需要提供范围 SomeLibraryB



目前要编译依赖于 SomeProjectA 的任何东西,还必须设置 SomeLibraryB 已经提供。我宁愿传播这个范围,然后有任何项目依赖于我的项目的依赖关系。

解决方案

我不认为这是可能的。每个项目都应该声明自己提供的依赖项。传播该范围将是错误的,因为您将对您无法做出的部署作出假设,因为您不对部署负责。您的图书馆的用户可以使用。


I have an Ancestor dependency has dependent scoped as provided, I need to propagate that scoping to anything that depends on my project.

For example, say I have SomeProjectA which depends on SomeLibraryB. I need to scope SomeLibraryB has provided.

Currently to compile anything that depends on SomeProjectA, has to also set SomeLibraryB has provided. I would rather propagate that scoping, then have any project that depend on mine deal with my project's dependents..

解决方案

I dont think that is possible. Each project should declare provided dependencies on its own. Propagating that scope would be wrong since you would make an assumption about the deployment that you cant make since you are not responsible for the deployment. The user of your library does that..

这篇关于Maven提供的范围可以传递吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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