在IntelliJ IDEA中更改sbt项目的常春藤缓存位置? [英] Changing Ivy Cache Location for sbt projects in IntelliJ IDEA?

查看:267
本文介绍了在IntelliJ IDEA中更改sbt项目的常春藤缓存位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IntelliJ 13.0.2中使用Scala项目获得了0.13.2。

I have sbt 0.13.2 with a Scala project in IntelliJ 13.0.2.

我只想更改我的默认 ../ .ivy2 / cache 路径。

I just want to change my default ../.ivy2/cache path.

我试图在 ../ bin / sbt 文件

-Dsbt.ivy.home=D:/IvyHome/.ivy

但没有运气。

即使在IDE中我也找不到这个地方更新 SBT_HOME

Even in the IDE I couldn't find the place to update SBT_HOME

解决方案是什么?

推荐答案

首先,你有两个SBT插件。您正在使用的Scala插件版本已经支持SBT,您不需要额外的插件。我建议您先删除额外的插件。

First of all you have two SBT plugins. The version of Scala plugin you're using already supports SBT, and you don't need an extra plugin. I recommend that you start by removing the extra plugin.

要删除非官方插件,请转到插件配置并删除SBT插件旁边的检查。这不会完全删除插件,但会将其禁用。

To remove the unofficial plugin go to plugins configuration and remove the check next to the SBT plugin. This will not remove the plugin completely, but will keep it disabled.

一旦只有一个插件,就可以通过转到选项并搜索 sbt 来修改缓存的位置。您应该在 IDE设置中找到一个条目。

Once you have only single plugin, you can modify the location of the cache, by going to options, and searching for sbt. You should find an entry in IDE Settings.

您应该看到 VM参数。单击输入旁边的图标,然后在最后一行添加 -Dsbt.ivy.home = D:/IvyHome/.ivy

You should see the VM Parameters. Click the icon next to the input, and add -Dsbt.ivy.home=D:/IvyHome/.ivy in the last line.

保存所有设置后,单击确定并重新启动IDE。

Click OK and restart the IDE after saving all settings.

现在您应该使用新的家庭位置(当然这仅适用于构建从IDE运行,如果从控制台使用SBT,它仍将使用旧的主页设置。)

Now you should be using the new home location (of course this is true only for the builds run from IDE, if you use SBT from console, it will still use an old home setting).

如上段所述。此更改不会影响从控制台运行的SBT。这是因为默认情况下IntelliJ使用捆绑的SBT。

As pointed out in the paragraph above. This change will not effect SBT ran from console. This is because by default IntelliJ uses bundled SBT.

如果你想修改你从控制台运行的sbt的Ivy home,你有几种方法可以做到这一点。

If you want to modify your Ivy home for sbt, which you run from console, you have several ways of doing that.

我认为最简单的方法是修改 SBT_HOME /中的 sbtconfig.txt 文件conf / sbtconfig.txt (仅适用于Windows - 在Linux上,您必须修改 sbtopts )。

I think the simplest is to modify the sbtconfig.txt file in the SBT_HOME/conf/sbtconfig.txt (Windows only - on Linux you'd have to modify sbtopts).

在文件末尾添加 -Dsbt.ivy.home = D:/IvyHome/.ivy

另一种方法是修改文档中描述的启动器配置

这篇关于在IntelliJ IDEA中更改sbt项目的常春藤缓存位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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