如何让 Eclipse 识别来自 SBT 的依赖项

How to have Eclipse recognize dependencies from SBT(如何让 Eclipse 识别来自 SBT 的依赖项)

本文介绍了如何让 Eclipse 识别来自 SBT 的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想弄清楚如何让 Eclipse 识别使用 SBT 检索的依赖项?SBT 下载正确的依赖项并将它们放在我的 ~/.ivy 目录中,但 eclipse 看不到它们.有没有办法做到这一点?

I am trying to figure out how to make Eclipse recognize dependencies that are retrieved using SBT? SBT download the correct dependencies and puts them in my ~/.ivy directory but eclipse doesn't see them. Is there a way to do this?

谢谢

推荐答案

这可能不是您正在寻找的答案,我承认它并不优雅,但它目前对我有用,这意味着我认为它需要更少的时间我会定期执行以下操作,而不是研究和寻找更优雅的解决方案.

This is probably not the answer you are looking for and I admit it is not elegant but it currently works for me, meaning that I think it takes less time for me to periodically do the following instead of researching and finding a more elegant solution.

我假设您使用的是 sbt-eclipse 插件( https://github.com/typesafehub/sbteclipse ).当我向我的项目添加新的依赖项时(这实际上很少见),我只需从插件重新生成我的 eclipse 项目文件.这样做的缺点是我有一个多模块项目,在 eclipse 中刷新项目后,我需要在 eclipse 构建路径编辑器中重新添加项目间依赖项.

I assume you are using the sbt-eclipse plugin ( https://github.com/typesafehub/sbteclipse ). When I add new dependencies to my project ( which is actually pretty rare ) I simply regenerate my eclipse project files from the plugin. The downside of this is that I have a multiple module project and after I refresh the projects in eclipse I need to re-add the inter-project dependencies in the eclipse build path editor.

就像我提到的那样,它非常老套,但总而言之,我真的不会浪费太多时间来做这件事.它不漂亮,但很有效.

Like I mentioned it is pretty hacky but all in all I really don't loose that much time doing it. It's not pretty but it works.

祝你好运,安迪

这篇关于如何让 Eclipse 识别来自 SBT 的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何让 Eclipse 识别来自 SBT 的依赖项

基础教程推荐