How to configure Ivy cache directory per-user or system-wide?

前端 未结 7 1094
说谎
说谎 2020-12-02 09:38

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

My problem is, I can\'t configure SBT to download dependencies to my user home directory. Therefore I a

相关标签:
7条回答
  • 2020-12-02 10:07

    The sbt.ivy.home property is only half of the solution. It controls where the sbt launcher downloads sbt itself (and related dependencies like the scala compiler and library, etc.) As noted by Joachim Hofer, it has no effect on where the dependencies declared by your project get downloaded.

    To change that location, you must set the ivy.home property. So, to augment Joachim's first solution, you would set both system properties:

    java -Dsbt.ivy.home=/tmp/.ivy2/ -Divy.home=/tmp/.ivy2/ -jar `dirname $0`/sbt-launch.jar "$@"
    

    With these properties, the launcher will download both your project's and sbt's dependencies to the /tmp/.ivy2/ directory. Of course, you can put them in separate directories as well.

    0 讨论(0)
提交回复
热议问题