Configure sbt to not utilize user home directory

前端 未结 3 562
既然无缘
既然无缘 2021-01-01 04:16

Last week we had the user directory permissions changed on our CI servers and we no longer have write access to the user home directory. Hence sbt fails to boot because it

相关标签:
3条回答
  • 2021-01-01 04:27

    The ivy path options mentioned in the other answers here were part of the solution. As pointed out in this answer you need to set ivy for both sbt itself and the project. Furthermore as I discovered on this sbt github issue comment, sbt needs yet another directory for its own stuff.

    In total, I used the following three jvm properties in order to use a relative path to the project for everything that sbt otherwise uses the user's home directory for:

    -Dsbt.global.base=./.sbt/ 
    -Dsbt.ivy.home=./.ivy2/ 
    -Divy.home=./.ivy2/ 
    

    At least as of sbt 0.13.9, this is what is needed.

    0 讨论(0)
  • 2021-01-01 04:41

    If you would like to run with your .ivy in a different location, and you're using sbt extras boot script, then you should just be able to do:

    sbt -ivy /path/to/ivy package
    

    and it'll download all the ivy stuffs to the location specified and run whatever command you need (in this example, package)

    0 讨论(0)
  • 2021-01-01 04:47

    You can set -ivy when using sbt-extras (preferable), or you can use a JVM property:

    -Dsbt.ivy.home=/path/to/ivy
    

    I've also used this:

    -Divy.default.ivy.user.dir=/path/to/ivy
    
    0 讨论(0)
提交回复
热议问题