Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run sbt with -Ylog-classpath

Tags:

scala

sbt

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?

like image 318
angelokh Avatar asked Apr 03 '15 02:04

angelokh


People also ask

How do I run with 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.

How do I run a Scala command line?

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.


1 Answers

-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.

like image 122
Mateusz Dymczyk Avatar answered Sep 18 '22 09:09

Mateusz Dymczyk