简体   繁体   中英

How to resolve libraryDependencies after sbt version upgrade to sbt 1.0

Hi my question refers to an old thread : Multi-version build with SBT

This is exactly how the library dependencies are mentioned in my project as well

libraryDependencies <++= (dispatchVersion) { (dv) => Seq(
  "net.databinder.dispatch" %% "dispatch-core" % dv,
  "net.databinder.dispatch" %% "dispatch-json4s-native" % dv
)}

but we have upgraded to sbt 1.0 which doesnt support this sort of library add. I've tried to import the scala file that contains the variable for eg. "dispatchVersion" which is of type settingKey[Map[symbol, String]] consists of all the latest version numbers similar to what you've mentioned.

How do i migrate the libraryDependencies similar to something mentioned above, as per the sbt version 1.0.0 syntax? The error that i'm getting is as below:

 error: No implicit for Append.Values[Seq[sbt.librarymanagement.ModuleID], sbt.Def.Initialize[Seq[sbt.librarymanagement.ModuleID]]] found,
      so sbt.Def.Initialize[Seq[sbt.librarymanagement.ModuleID]] cannot be appended to Seq[sbt.librarymanagement.ModuleID]
    libraryDependencies ++= dispatchVersion { v => Seq(
libraryDependencies ++= Seq(
  "net.databinder.dispatch" %% "dispatch-core"          % dispatchVersion.value,
  "net.databinder.dispatch" %% "dispatch-json4s-native" % dispatchVersion.value,
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM