SBT,依赖项,类路径和编辑器 [英] SBT, dependencies, classpath and editors

查看:113
本文介绍了SBT,依赖项,类路径和编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将我的sbt设置更新为0.11版。您可能知道,新SBT使用.ivy2文件夹来存储/缓存所有检索到的jar文件。我正在使用IntelliJ,我想知道将依赖项导入编辑器的类路径的推荐方法。

I recently updated my sbt setup to version 0.11. As you may know, new SBT uses .ivy2 folder to store/cache all the retrieved jar files. I am using IntelliJ and I would like to know what is the recommended way of importing dependencies to the editor's classpath.

一个选项是手动访问.ivy2文件夹并选择依赖。有更好/更简单的方法吗?

One option is to manually visit .ivy2 folder and select the dependencies. Is there a better/easier way to doing this?

推荐答案

我假设您使用SBT-plugin 。根据链接页面上的说明:

I presume you use the SBT-plugin. According to the instructions on the linked page:


每次更改依赖项后,在SBT控制台中运行gen-idea。出现提示时,重新加载项目。

After each change to your dependencies, run gen-idea in the SBT Console. When prompted, reload the project.

我通常运行
gen-idea no-classifiers否-sbt-classifiers
(参见 github 上的用法)。 IntelliJ(11 RC)将要求您重新加载项目,这通常非常快。然后,您的SBT依赖项的引用将可用。

I usually run gen-idea no-classifiers no-sbt-classifiers (see under "Usage" on github). IntelliJ (11 RC) will then ask you to reload the project, which is usually quite fast. Then the references to your SBT dependencies will be available.

这篇关于SBT,依赖项,类路径和编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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