sbt 中有没有办法将编译器警告转换为错误,从而导致构建失败? [英] Is there a way in sbt to convert compiler warnings to errors so the build fails?

查看:40
本文介绍了sbt 中有没有办法将编译器警告转换为错误,从而导致构建失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁止"部分或全部编译器警告.

I want to "ban" some or all compiler warnings.

推荐答案

您可以将选项从 sbt 传递给 Scala 编译器,包括将警告转换为错误的选项.

You can pass options from sbt to the scala compiler, including the one that turns warnings into errors.

我通常添加这些:

scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature", "-Xfatal-warnings"),

这篇关于sbt 中有没有办法将编译器警告转换为错误,从而导致构建失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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