I got an error like this when I run '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.)
How can I pass -Ylog-classpath
to sbt?
You can run sbt tasks by selecting the one you need from the sbt Tasks directory in the sbt tool window. You can manually enter your task (code completion is supported) in the sbt shell and run it directly from there. You can create a run configuration for a task.
To run Scala from the command-line, download the binaries and unpack the archive. Start the Scala interpreter (aka the “REPL”) by launching scala from where it was unarchived. Start the Scala compiler by launching scalac from where it was unarchived.
-Y
is just a scalac
parameter. There are two types as per the doc -Y
being private and -X
being advanced. The difference is that private ones can be removed without prior notice and you should be aware of that fact.
To add scalac
options add to your build.sbt
file this line:
scalacOptions += "-Ylog-classpath"
Similarly you can add javac
options with javacOptions
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With