Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt - add unmanaged resources to console

Tags:

scala

sbt

In sbt, I want to add a config directory to the runtime class-path (but not export it as part of package). So I have this:

unmanagedClasspath in Runtime += baseDirectory.value / "config"

This works fine for sbt run, but apparently is not on the class-path if I use sbt console.

How can I add this directory to the class-path for the console task without it showing up in the exported jar?


Edit: I also tried the following, but I still cannot get the resources:

unmanagedClasspath in (Compile, console) += baseDirectory.value / "config"
like image 779
0__ Avatar asked Nov 10 '22 02:11

0__


1 Answers

Actually adding the following does work:

unmanagedClasspath in Compile += baseDirectory.value / "config"

I had found the contents in "config" only because the package was created previously and using sbt clean package shows that now the contents of "config" will not be packaged any longer but do appear on the console class-path.

like image 116
0__ Avatar answered Nov 15 '22 11:11

0__