使用-Ylog-classpath运行sbt

时间:2015-04-03 02:15:09

标签: scala sbt

当我运行' sbt compile':

时,我收到了这样的错误
missing or invalid dependency detected while loading class file 'DefaultReads.class'.
[error] Could not access term time in package java,
[error] because it (or its dependencies) are missing. Check your build definition for
[error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)

如何将-Ylog-classpath传递给sbt?

1 个答案:

答案 0 :(得分:22)

-Y只是scalac参数。根据{{​​3}} -Y为私有,-X为高级,有两种类型。不同之处在于私人可以在不事先通知的情况下删除,您应该知道这一事实。

要添加scalac个选项,请在此行添加build.sbt文件:

scalacOptions += "-Ylog-classpath"

同样,您可以使用javac添加javacOptions个选项。