How to build using SBT in offline mode

2019-05-03 20:44发布

问题:

What is the equivalent of mvn -o in SBT? When I check my .ivy repository, I can see the dependecy jars in cache/groupId/artifactId/jars. When I try to build it without internet connection, it still does this Resolving ... thing and shows Unresolved Dependencies error. How can I turn this off? I tried using sbt set-offline := true but still gets the error. Is this possible? Maybe download once and save the artifacts in .m2 like maven and get it from there if its not possible in .ivy

回答1:

Are you sure you got absolutely all your dependencies ?

  • dependencies for SBT => downloaded when SBT starts
  • plugins dependencies => downloaded during project loading
  • Project dependencies => downloaded when the related tasks are started, e.g. compile time deps on 'compile', test deps on 'test', etc...


回答2:

Try set skip in update := true