Working offline with SBT and SNAPSHOT dependencies

前端 未结 4 383
梦如初夏
梦如初夏 2020-12-28 16:28

I have never been able to work offline with SBT on any of my projects. Now I\'m in the middle of a move and my wardrobe-server hosting nexus is offline.

So running s

4条回答
  •  萌比男神i
    2020-12-28 17:25

    This seems like a terrible hack, but you can specify your ivy cache as an ivy repository, so that once your dependencies are downloaded, they can be resolved from the cache.

    For example, your ~/.sbt/repositories could look like this:

    [repositories]
      local
      maven-central
      cache: file://${user.home}/.ivy2/cache, [organisation]/[module]/ivy-[revision].xml, [organisation]/[module]/[type]s/[module]-[revision].[type]
    

    Note: I had to set the ivy and artifact patterns explicitly. Add the local cache below any other repos so they get tried first.

提交回复
热议问题