我正在为我的项目创建一个build.sbt,它有像
这样的依赖项 libraryDependencies ++= Seq(
"com.typesafe.akka" % "akka-actor_2.11" % "2.3.15",
"org.scalaz" % "scalaz-core_2.11" % "7.2.0",
"org.scalactic" % "scalactic_2.11" % "2.2.6" ,
"org.scalatest" % "scalatest_2.11" % "2.2.6" % "test",
"org.scalamock" % "scalamock-scalatest-support_2.11" % "3.2.2" % "test",
"org.springframework" % "spring-context" % "4.1.6.RELEASE",
"org.springframework" % "spring-beans" % "4.1.6.RELEASE",
"org.springframework" % "spring-core" % "4.1.6.RELEASE",
"org.springframework" % "spring-context" % "4.1.6.RELEASE",
"org.springframework" % "spring-web" % "4.1.6.RELEASE",
"com.google.guava" % "guava" % "14.0.1",
"com.google.code.gson" % "gson" % "2.3",
"commons-lang" % "commons-lang" % "2.5",
"net.sf.opencsv" % "opencsv" % "2.3",
"com.thoughtworks.xstream" % "xstream" % "1.4.8",
"commons-io" % "commons-io" % "1.4",
"commons-codec" % "commons-codec" % "1.6",
"commons-collections" % "commons-collections" % "3.2.2",
"commons-logging" % "commons-logging" % "1.1.1",
"org.apache.httpcomponents" % "httpclient" % "4.3.3",
"org.apache.httpcomponents" % "httpmime" % "4.3.3",
"jmdns" % "jmdns" % "0.2",
"com.sun.mail" % "javax.mail" % "1.5.4",
"junit" % "junit" % "4.12" % "test"
)
我想在其他地方指定版本作为变量,并引用依赖项中的那些(变量)。 可以像在gradle中那样完成吗?
答案 0 :(得分:7)
在val
中声明build.sbt
,您可以在依赖项中引用它。示例:https://github.com/softwaremill/bootzooka/blob/master/build.sbt#L18