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

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

问题描述

我工作空间中的Gradle项目(称为下游)需要依赖于另一个Gradle项目(称为 Upstream )。在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集成)执行此操作(该选项称为从Workspace解析依赖关系)。 Gradle Eclipse插件有一个名为 Remap 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?

推荐答案

事实证明,这是是一个 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".

如果您没有看到重新映射到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天全站免登陆