调用任务失败如何让sbt直接失败?

How to let sbt fail directly if the calling task is failed?

在一个 shell 文件中,我调用一个 sbt 任务来做一些事情,然后再做一些其他事情。

但是我发现如果任务失败sbt会阻塞shell,sbt会等待回答:

Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

有没有办法让 sbt 失败?因为 shell 文件是 CI 上的 运行,它将永远阻止它。

sbt支持-batch可以解决这个问题:

sbt -batch