sbt -Dsbt.ivy.home=/your/local/path/.ivy
Then the dependencies and the other files downloaded for sbt will be stored in the cache
folder of the new location.
e.g.)
ivy.home=/your/local/path/.ivy
the cache=/your/local/path/.ivy/cache
This solution is only for sbt installed using brew on Mac OSX.
If sbt build process causes OutOfMemoryError
like,
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
Add the following lines to the /usr/local/etc/sbtopts
file.
-J-XX:+CMSClassUnloadingEnabled
-J-Xmx2048m
-J-XX:MaxMetaspaceSize=512m
Change 2048
in -J-Xmx2048m
(It's 2GiB) and 512
in -J-XX:MaxMetaspaceSize=512m
as required.
The maximum heap size can be set on the fly like
$ sbt -d -J-Xmx1024m compile
Scala.js may take lots of memory to do full optimization so it might be necessary to do like
$ sbt -d -J-Xmx2048m fullOptJS