【问题标题】:how can I change the coursier cache directory of the bundled sbt in IntelliJ如何在 IntelliJ 中更改捆绑 sbt 的 coursier 缓存目录
【发布时间】:2021-07-24 15:48:27
【问题描述】:

我已将本地 coursier 缓存迁移到系统的另一部分并更改了 COURSIER_CACHE 系统属性,如 in the coursier docs 所述

我本地安装的 SBT 可以通过 shell 以及 IntelliJ 的 sbt shell 正常工作。但是,在使用 IntelliJ 的内置 SBT 使用 CTRL+F9 构建我的应用程序时,我收到以下错误:

scalac: Scala compiler JARs not found (module 'solipsism'): C:\Users\<user>\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\org\scala-lang\scala-library\2.13.5\scala-library-2.13.5.jar, <etc>

C:\Users\&lt;user&gt;\AppData\Local\Coursier\cache 是默认的 coursier 缓存位置。

到目前为止,我尝试将以下 VM 参数添加到
Settings > Build Execution Deployment > sbt > VM Parameters
,但没有成功:

-Dcoursier.cache=<repo dir>
-Dsbt.coursier.home=<repo dir>

in the SBT docsin the coursier docs again 所述

使用csrCacheDirectory 通过 IntelliJ 的 SBT shell 验证这些设置表明它们被正确拾取,但构建错误仍然存​​在。

如何更改默认构建的 coursier 缓存目录?

使用 Windows 10、IntelliJ CE 2021.1.1、SBT 1.5.1

谢谢,

干杯, 约斯特·帕彭多普

【问题讨论】:

    标签: scala intellij-idea sbt


    【解决方案1】:

    找到原因:IntelliJ 以某种方式在项目结构中保留了指向旧存储库的链接。这显然不能通过重新导入项目来解决。

    解决方案:删除整个 Intellij 项目(不仅仅是模块)。关闭 IDE。开始新项目。重新导入模块。

    优雅。

    【讨论】:

      猜你喜欢
      • 2019-09-20
      • 2023-04-10
      • 1970-01-01
      • 1970-01-01
      • 2016-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-25
      相关资源
      最近更新 更多