如何为每个用户或系统范围配置Ivy缓存目录? [英] How to configure Ivy cache directory per-user or system-wide?

查看:71
本文介绍了如何为每个用户或系统范围配置Ivy缓存目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 SBT 作为构建Scala项目的构建工具.

I am using SBT as my build tool for building a Scala project.

我的问题是,我无法配置SBT将依赖项下载到我的用户主目录.因此,我正在寻找针对每个用户甚至更好的系统范围的设置,以告知SBT将Ivy缓存目录放置在其他位置.

My problem is, I can't configure SBT to download dependencies to my user home directory. Therefore I am looking for a per-user or even better a system-wide setting to tell SBT to put the Ivy cache directory somewhere else.

使用maven时,可以使用每个用户的settings.xml来配置本地存储库.

With maven there is the per-user settings.xml that can be used to configure the local repository.

我已阅读问题如何覆盖常春藤缓存的位置? 及其答案,但似乎只描述了如何基于每个项目配置设置.

I have read question How to override the location of Ivy’s Cache? and it's answers, but it seems it only describes how to configure the setting on a per project basis.

如果没有其他选择,我将按项目进行设置,但是我无法从上述问题中得到答案.一些更多的细节将是非常受欢迎的,例如,将ivysettings.xml放在何处.我把它放到了项目的根目录下,但是没用.

If there is no alternative I would go for a per-project setting, but I didn't get the answer from the mentioned question to work. Some more details would be most welcome, for example where to put the ivysettings.xml. I put it into the project's root directory and it didn't work.

推荐答案

您可以简单地将环境变量添加到sbt启动shell脚本中:

You can simply add an environment variable to your sbt launch shell script:

java -Dsbt.ivy.home=/tmp/.ivy2/ ...

请参阅官方文档中的图书馆管理

这篇关于如何为每个用户或系统范围配置Ivy缓存目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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