读取poms时自动导出InteliJ Idea中的依赖项?
我尝试在此处和 jetbranis.net 上进行搜索,但没有找到答案。
我使用 Maven 创建了一个项目 (P),该项目具有模块 (A,*B*)。模块A依赖于模块B,模块B依赖于库R。当我使用 InteliJ Idea 10.0.1 打开 P 时,一切都很顺利。我遇到的唯一问题是依赖处理。
依赖项是传递导入的。 A、*B* 现在都依赖于库 R。我希望 B 依赖于 R,但我希望 R 被导出,A 被导出仅依赖于B。
我发现jetbrains上的一些旧帖子似乎是相关的,但似乎他们有相反的问题 http:// devnet.jetbrains.net/thread/286098。有人能给我建议吗?我错过了一些配置选项吗?
i tried to search both here and on jetbranis.net however i did not found an answer.
I have created a project (P) using maven that have to modules (A,*B*). The module A is dependant on module B and module B is dependent on libraries R. When I open P using the InteliJ Idea 10.0.1 everything works smoothly. The only problem that i have is dependency handling.
The dependencies were imported transitively. Both A,*B* are now dependent on libraries R. I would expect B to be dependent on R, but i would expect R to be exported and A to be dependent only on B.
I found some old posts on jetbrains that seam to be related, however it seams that they have opposite problem http://devnet.jetbrains.net/thread/286098. Can anybody advise me please? Did i missed some configuration option?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是 Maven 的依赖关系的工作方式;每个模块(又名 Maven 项目)都有一个独立的类路径。导入到 IDEA 中的依赖关系不会“导出”,以防止传递依赖关系之间的干扰。
This is how Maven's dependencies work; each module (aka Maven Project) has an isolated classpath. Dependencies, imported into IDEA, are not 'exported' to prevent interference between transitive dependencies.