Eclipse/STS 中的 Gradle 项目是否可以解决对同一工作区中其他 Gradle 项目的依赖关系? [英] Is it possible for Gradle projects in Eclipse/STS to resolve dependencies to other Gradle projects in the same workspace?

查看:19
本文介绍了Eclipse/STS 中的 Gradle 项目是否可以解决对同一工作区中其他 Gradle 项目的依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作区中的 Gradle 项目(称为下游)需要依赖另一个 Gradle 项目(称为上游).在 Eclipse 之外,当然 上游 需要在 下游 之前构建和安装(以便 Gradle 可以解决它).在 Eclipse 中,由于两个项目都在工作区中,我希望 Gradle 首先查看工作区并在项目之间建立依赖关系,而不是从 repo.

A Gradle project in my workspace (call it Downstream) needs to depend on another Gradle project (call it Upstream). Outside of Eclipse, of course Upstream would need to be build and installed before Downstream (so that Gradle can resolve it). In Eclipse, since both projects are in the workspace together, I'd like to have Gradle look in the workspace first and make the dependency between the projects, not from the repo.

m2e(Eclipse 的 Maven 集成)执行此操作(该选项称为从工作区解析依赖项).Gradle Eclipse 插件有一个名为将 Jars 重新映射到 maven 项目的选项,但这似乎适用于 pom 驱动的 m2e 项目,而不是其他 Gradle 项目.

m2e (Maven integration for Eclipse) does this (the option is called Resolve dependencies from Workspace). Gradle Eclipse plugin has an option called Remap Jars to maven projects but that seems to do this for pom-driven m2e projects, not other Gradle projects.

有什么方法可以让 Gradle 解决对本地工作区的依赖(当它们存在时)而不是 repo?

Is there any way to get Gradle to resolve dependencies to the local workspace (when they're present) instead of the repo?

推荐答案

原来这个 is 是一个 Gradle IDE 的未完成功能请求.已为 Gradle IDE 3.6.3 版本提供.

It turns out this is was an outstanding feature request for Gradle IDE. It has been delivered for the 3.6.3 release of Gradle IDE.

确实必须启用它:

必须在 Gradle 首选项页面中启用该功能.使用权通过窗口 >> 首选项 >> Gradle".

The feature has to be enabled in the Gradle preferences page. Access via "Window >> Preferences >> Gradle".

如果您在那里没有看到将 jars 重新映射到 Gradle 项目",那么也许仔细检查一下 Gradle 插件的版本确实是 3.6.3.升级过程中可能出现问题,而您仍在使用一个旧版本.来源

If you are not seeing the "remap jars to Gradle projects" there then maybe double check that version of the Gradle plugins is indeed 3.6.3. Maybe something went wrong during the upgrade and you are still using an older version. Source

这篇关于Eclipse/STS 中的 Gradle 项目是否可以解决对同一工作区中其他 Gradle 项目的依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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