crockpotveggies
crockpotveggies

Reputation: 13300

Play! 2.1 / Why isn't my Jerkson dependency resolved?

Attempting to use the forked Jerkson library from https://github.com/randhindi/jerkson. Cloned a source dependency into the folder module and defined the following:

object ApplicationBuild extends Build {

  val appName         = "coolapp"
  val appVersion      = "1.0-SNAPSHOT"

  lazy val jerkson = Project(
    id = "jerkson",
    base = file("module"),
    settings = Seq(
      name               := "jerkson",
      organization       := "com.codahale",
      version            := "0.6.0-SNAPSHOT",
      scalaVersion       := "2.10.0"
    )
  )

  val appDependencies = Seq(
    "com.codahale" % "jerkson" % "0.6.0-SNAPSHOT",
    "jp.t2v" %% "play2.auth"      % "0.9",
    "jp.t2v" %% "play2.auth.test" % "0.9" % "test",
    "org.ocpsoft.prettytime" % "prettytime" % "1.0.8.Final",
    "com.typesafe" %% "play-plugins-redis" % "2.1-1-RC2",
    "net.databinder.dispatch" %% "dispatch-core" % "0.10.0"
  )

// resolvers follow
}

However, when I go to compile it gives me the following error:

sbt.ResolveException: unresolved dependency: com.codahale#jerkson;0.6.0-SNAPSHOT: not found

Any guesses here? Strangely this is the first time I've ever needed to resolve a source dependency so spare the ignorance. Thanks!

Upvotes: 1

Views: 744

Answers (2)

prayagupadhyay
prayagupadhyay

Reputation: 31222

This library should be available at "http://repo.typesafe.com/typesafe/releases", so no need mention other resolvers; following build script just adding "com.cloudphysics" % "jerkson_2.10" % "0.6.3" should work.

    1 import play.Project._                                                                                                                           
    2                                                                                                     
    3 name := "smartad-backend"                                                                           
    4                                                                                                     
    5 version := "1.0"                                                                                    
    6                                                                                                     
    7 playScalaSettings                                                                                   
    8                                                                                                     
    9                                                                    
   10 libraryDependencies ++= Seq(                                                                        
   11                             jdbc,                                                                   
   12                             anorm,                                                                  
   13                             "com.google.zxing"   % "core"                 % "2.0",                  
   14                             "mysql"              % "mysql-connector-java" % "5.1.27",               
   15                             "com.typesafe.slick" %% "slick"               % "2.1.0",                
~  16                             "org.slf4j"          % "slf4j-nop"            % "1.6.4",                
+  17                             "com.cloudphysics" % "jerkson_2.10" % "0.6.3"                           
   18                                     
   19                            )  

Above build script is for play framework 2.2.0.

Upvotes: 0

Mik378
Mik378

Reputation: 22171

Make sure you've added this repository to your resolvers sequence in your Build.scala:

resolvers ++= Seq("Codahale" at "http://repo.codahale.com")

----------UPDATE:

The repo.codahale.com contains only Jerkson jars for scala 2.9.x

Try this repo instead in order to grab a jar compatible with scala 2.10.x (which Play 2.1 uses):

https://github.com/cphylabs/jerkson

This link suggests to merely add:

"com.cloudphysics" % "jerkson_2.10" % "0.6.3" 

Upvotes: 3

Related Questions