8

In play 2.1 and prior I had to add the resolvers in Build.scala like:

val main = play.Project(appName, appVersion, appDependencies).settings(
    resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.io/releases/"))(Resolver.ivyStylePatterns),
    resolvers += Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.github.io/snapshots/"))(Resolver.ivyStylePatterns)
  )

In 2.2 I have to put it in build.sbt like:

...
resolvers += "Objectify Play Snapshot Repository" at "http://schaloner.github.com/snapshots/"
...

But that does not seem to work, dependencies are not found.

Any Ideas?

reen
  • 2,483
  • 5
  • 29
  • 40

3 Answers3

12

You are adding it as a maven repository but in your old config you are saying that it is ivy repositories, I think it should be something like:

resolvers += Resolver.url("Repo-name", url("http://example.com/"))(Resolver.ivyStylePatterns)

Checkout the sbt 0.13 (which play 2.2 uses) docs on resolvers for more info: http://www.scala-sbt.org/release/docs/Detailed-Topics/Resolvers.html

johanandren
  • 11,249
  • 1
  • 25
  • 30
  • Hi johanandren, thanks for your answer. I think that would be the case for Play 2.1. But with that I would have duplicate definitions (name and version in build.sbt and Build.scala). I solved it without duplicate definitions. See my answer. – reen Sep 27 '13 at 16:01
4

Update:

This solution is not working, I had the dependencies in the cache.

I solved it like this:

project/plugins.sbt:

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers ++= Seq(
        Resolver.url("Objectify Play Repository", url("http://schaloner.github.io/releases/"))(Resolver.ivyStylePatterns),
        "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
)

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

And then I can add the dependency in build.sbt:

name := "test"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache,
  "be.objectify" %% "deadbolt-java" % "2.2-RC1"
)     

play.Project.playJavaSettings
reen
  • 2,483
  • 5
  • 29
  • 40
  • 1
    This doesn't work on Play 2.2.1. Check here: http://stackoverflow.com/questions/19928495/installing-deadbolt-on-play-framework-2-2-1 – Fred K Nov 12 '13 at 16:45
0

For future reference, just add it alone in a new line at the end of build.sbt

Check http://www.playframework.com/documentation/2.2.x/Build

name := "my-app"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
...
)     

play.Project.playJavaSettings

resolvers += "itext repository" at "http://jasperreports.sourceforge.net/maven2/"
aldo.roman.nurena
  • 1,323
  • 12
  • 26