larsrh larsrh - 1 month ago 8
Scala Question

How to specify a dependency that does not appear in the published artifact?

I have a build that contains two modules

a
and
b
.
b
depends on
a
.
a
contains only resources (think: logging configuration). Locally, if I run the sbt task
b/console
, I want
a
to be on the classpath. However, I don't want to publish
a
and hence don't want the dependency to appear in
b
's artifact. How can I configure this?

Answer Source

You can use the 'provided' scope when adding the library dependency

libraryDependencies += "javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided"