How to have Eclipse recognize dependencies from 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 的依赖项
基础教程推荐
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01