如何要求 sbt 只获取依赖项而不编译? [英] How to ask sbt to only fetch dependencies, without compiling?

查看:19
本文介绍了如何要求 sbt 只获取依赖项而不编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法只下载依赖而不编译源码.

Is there a way to only download the dependencies but do not compile source.

我之所以这么问,是因为我正在尝试为我的更大项目构建一个 Docker 构建环境.想法是在 docker build 我克隆项目,下载所有依赖项,然后删除代码.然后使用docker run -v将经常变化的代码挂载到docker容器中,开始编译项目.

I am asking because I am trying to build a Docker build environment for my bigger project. The Idear is that during docker build I clone the project, download all dependencies and then delete the code. Then use docker run -v to mount the frequently changing code into the docker container and start compiling the project.

目前我只是在构建期间编译代码,然后在运行时再次编译.问题在于,当依赖项发生变化时,我必须从头开始构建,这需要很长时间.

Currently I just compile the code during build and then compile it again on run. The problem ist that when a dependencie changes I have to build from scratch and that takes a long time.

推荐答案

运行 sbt 的 update 命令.将解析和检索依赖项.

Run sbt's update command. Dependencies will be resolved and retrieved.

这篇关于如何要求 sbt 只获取依赖项而不编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆