I have a dependency in runtime
scope in a Maven project:
<dependency>
<groupId>org.docbook</groupId>
<artifactId>docbook-xml</artifactId>
<version>4.4</version>
<scope>runtime</scope>
</dependency>
How can I express this in SBT?
You should use runtime configuration for the dependency in build.sbt
as follows:
libraryDependencies += "org.docbook" % "docbook-xml" % "4.4" % "runtime"
With this, classpath should be properly set - show managedClasspath
for compile
and runtime
configurations to verify it:
[sbt-13-0-1]> help dependencyClasspath
The classpath consisting of internal and external, managed and unmanaged dependencies.
[sbt-13-0-1]> show managedClasspath
[info] List(Attributed(/Users/jacek/.sbt/boot/scala-2.10.3/lib/scala-library.jar))
[success] Total time: 0 s, completed Jan 1, 2014 12:10:57 AM
[sbt-13-0-1]> show runtime:managedClasspath
[info] List(Attributed(/Users/jacek/.sbt/boot/scala-2.10.3/lib/scala-library.jar), Attributed(/Users/jacek/.ivy2/cache/org.docbook/docbook-xml/jars/docbook-xml-4.4.jar))
[success] Total time: 0 s, completed Jan 1, 2014 12:11:01 AM
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