我正在使用Jenkins进行测试和部署。从日志中可以看到,Jenkins构建从Nexus接收了所有库,从Nexus下载需要花费毫秒:
...
[0m[[0minfo[0m] [0mdownloading http://nexus-url:8081/nexus/sbt_0.13/0.8.0/jars/sbt-revolver.jar ...[0m
[0m[[0minfo[0m] [0m [SUCCESSFUL ] io.spray#sbt-revolver;0.8.0!sbt-revolver.jar (28ms)[0m
[0m[[0minfo[0m] [0mdownloading http://nexus-url:8081/nexussbt-scalariform-1.6.0.jar ...[0m
[0m[[0minfo[0m] [0m [SUCCESSFUL ] org.scalariform#sbt-scalariform;1.6.0!sbt-scalariform.jar (34ms)[0m
...
但是在从Nexus下载之间,有时有时需要很长时间(最多2小时,通常只有5分钟)来解决依赖关系。
在这段时间内,我看到缓慢出现的Resolving..
日志消息:
...
[2K[0m[[0minfo[0m] Resolving org.scalastyle#scalastyle_2.10;0.8.0 ...
[2K[0m[[0minfo[0m] Resolving org.scalastyle#scalastyle_2.10;0.8.0 ...
[2K[0m[[0minfo[0m] Resolving com.typesafe#config;1.2.0 ...
[2K[0m[[0minfo[0m] Resolving com.typesafe#config;1.2.0 ...
[2K[0m[[0minfo[0m] Resolving org.scoverage#sbt-scoverage;1.3.5 ...
[2K[0m[[0minfo[0m] Resolving org.scoverage#sbt-scoverage;1.3.5 ...
[2K[0m[[0minfo[0m] Resolving org.scoverage#scalac-scoverage-plugin_2.10;1.1.1 ...
[2K[0m[[0minfo[0m] Resolving org.scoverage#scalac-scoverage-plugin_2.10;1.1.1 ...
...
命令:sbt clean test $PROJECT_NAME/assembly
我在Nexus上为它设置了本地时间(在删除〜/ .ivy1,〜/ .sbt和所有/ target文件夹之后),并且它总是可以非常快速地解决所有问题。
如果库的下载速度非常快,那么长解析度的原因可能是什么?
它是否可以依赖Jenkins机器资源(在此期间是否有繁重的操作)?