我在Maven项目的runtime
范围内有依赖关系:
<dependency>
<groupId>org.docbook</groupId>
<artifactId>docbook-xml</artifactId>
<version>4.4</version>
<scope>runtime</scope>
</dependency>
我如何在SBT中表达这一点?
答案 0 :(得分:6)
您应该使用运行时配置为build.sbt
中的依赖项,如下所示:
libraryDependencies += "org.docbook" % "docbook-xml" % "4.4" % "runtime"
这样,应该为show managedClasspath
和compile
配置正确设置类路径runtime
以验证它:
[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