Dreams
Dreams

Reputation: 6122

Adding db2 jcc jar in sbt

I am making a project in which I need to use the db2jcc jar. But, I am unable to add it to the build.sbt file. Can someone guide as to what is the right way to add it to library dependencies. I have attached the library dependencies I am using. I have tried a few things but sbt fails to resolve them. I don't want to add it as external library(it works but the project requires me to add it in sbt for further deployment)

libraryDependencies ++= Seq(

// akka core
"com.typesafe.akka" %% "akka-actor"      % "2.3.14",
"com.typesafe.akka" %% "akka-testkit"    % "2.3.14",
// akka http
"com.typesafe.akka" %% "akka-http-experimental"    % "1.0",
"com.typesafe.akka" %% "akka-http-spray-json-experimental" % "1.0",
"com.typesafe.akka" %% "akka-http-xml-experimental" %"1.0",
//"com.ibm.db2.jcc" % "db2jcc4" % "10.1"
//"cn.guoyukun.jdbc" % "db2jcc" % "1.4.2"
//"com.ibm" %% "db2jcc" % "9"
//"com.ibm.db2.jcc" % "db2jcc" % "3.63.123"
//"com.ibm.db2.jcc" %% "db2jcc4" % "4.19.66"
//"com.ibm.db2.jcc" %% "db2jcc4" % "4.21.29"
//"com.ibm.db2.jcc" % "db2jcc4" % "4.22.29"
//"com.ibm" % "db2jcc" % "10.5"
//"com.ibm.db2.jcc" % "db2jcc4" % "10.5"
//"com.ibm.db2.jcc" % "db2jcc" % "4.19.66"

I tried the commented parts. But sbt is unable to resolve it. Please guide. Thanks in advance.

Upvotes: 1

Views: 475

Answers (1)

Nagireddy Hanisha
Nagireddy Hanisha

Reputation: 1440

Create a lib folder under your project root folder and add the dashdb jar in it.

Try adding this line to your build.sbt

unmanagedJars in Compile += file("/lib/db2jcc4-10.1.jar")

Then create your uber jar using assembly command in SBT Console.

Upvotes: 1

Related Questions