How to get sbt to extract everything you need?

I am working on a project in a very vulnerable security place, without access through a proxy server to all online repositories that SBT usually requires. We would like to get the dependencies and transitional dependencies that we need once.

How to make sbt get all the dependencies that the project requires, and from there, work only offline? I tried to do just that from home. Then I copied everything that:

~/.ivy2/cache
~/.ivy2/local
$ACTIVATOR_HOME/repository

but still SBT, even when executed with sbt "set offline := true" run, goes and tries to extract everything on the Internet ... it's a pain. Then, finally, it breaks down and complains that it does not find dependence.

UPDATE . I noticed another source of problems, but so far I can’t conclude that he is responsible for the problem with the broken assembly of the OP. I create and get dependencies for the project on Linux (Ubuntu box), and then copy all the files to the corporate environment of Windows 7 Pro. I found that many properties files in ~/.ivy2/cachebelong to the absolute path of the activator repository directory in Ubuntu, and this, of course, is not true in Windows env, for example.

#ivy cached data file for ch.qos.logback#logback-classic;1.1.3
#Fri Mar 10 08:39:37 CET 2017
artifact\:ivy\#ivy.original\#xml\#-1844423371.location=/opt/dev/activator/1.3.12/repository/ch.qos.logback/logback-classic/1.1.3/ivys/ivy.xml
artifact\:ivy\#ivy\#xml\#1016118566.is-local=true
artifact\:ivy\#ivy\#xml\#1016118566.location=/opt/dev/activator/1.3.12/repository/ch.qos.logback/logback-classic/1.1.3/ivys/ivy.xml
artifact\:ivy\#ivy.original\#xml\#-1844423371.is-local=true
artifact\:ivy\#ivy\#xml\#1016118566.exists=true
artifact\:logback-classic\#jar\#jar\#804750561.is-local=true
artifact\:logback-classic\#jar\#jar\#804750561.location=/opt/dev/activator/1.3.12/repository/ch.qos.logback/logback-classic/1.1.3/jars/logback-classic.jar
artifact\:ivy\#ivy.original\#xml\#-1844423371.exists=true
artifact\:logback-classic\#jar\#jar\#804750561.exists=true

So, I went and found and replaced, but the assembly still does not work. It doesn't seem like the brilliant idea that thousands of hardcoding property files are an absolute path to an activator location. I would prefer that they use an environment variable for this.

+4
1

, coursier?

- , (SBT , )

, - . , .

+1

Source: https://habr.com/ru/post/1672013/


All Articles