Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala REPL: How to add remote Maven repository to Scala REPL classpath?

Scala REPL is great for trying different code snippets. It would be great if one could run code using libraries from Maven repositories in Scala REPL. How to add remote Maven repository to Scala REPL classpath?

like image 768
Anton Ashanin Avatar asked Mar 27 '13 18:03

Anton Ashanin


2 Answers

You can do it, using maven-scala-plugin:

$ mvn scala:console
...
import com.some.dependency
like image 105
Alex Yarmula Avatar answered Oct 11 '22 18:10

Alex Yarmula


I do everything non-trivial in SBT. In one place, the SBT build.sbt (or .scala, for advanced uses) you define all your dependencies, generate your IDE project files and run REPLs with all dependencies present in the class-path.

like image 35
Randall Schulz Avatar answered Oct 11 '22 18:10

Randall Schulz