Question

I created a sandbox play project for testing. It was building and passing the tests on Travis CI. I added dependency on swagger-play2 and it started failing the tests with error message:

sbt.ResolveException: download failed: com.typesafe.play#play_2.10;2.2.1!play_2.10.jar(src)

Steps to reproduce:

  1. Create default play scala project
  2. Build passes before adding swagger
  3. Adding swagger to build.sbt
  4. Build now fails :(
  5. Remove swagger dependency
  6. Build now passes again!

It seems strange adding dependency on swagger would trigger this build failure. What am I doing wrong? Feel free to send a pull request on the github project if you want to test your fixes ((Travis should auto build your pull request).

Complete GitHub project history: https://github.com/pathikrit/play-test/commits/master

Complete Travis-CI build history: https://travis-ci.org/pathikrit/play-test/builds

Commit that triggers build failure: https://github.com/pathikrit/play-test/commit/d8ad88083b56dd0269eaefc30025a42f54f0dba5

Was it helpful?

Solution 2

I now have a script to setup the dependencies:

PLAY_VERSION=2.2.1
wget http://downloads.typesafe.com/play/${PLAY_VERSION}/play-${PLAY_VERSION}.zip
      unzip play-${PLAY_VERSION}.zip -d ${HOME}
      # Manually populate the play directory with missing jars - TODO: remove this hack (see http://stackoverflow.com/questions/21361621/)
      SCALA_VERSION=2.10
      MAVEN_PLAY=http://repo.typesafe.com/typesafe/maven-releases/com/typesafe/play/play_${SCALA_VERSION}/${PLAY_VERSION}/play_${SCALA_VERSION}-${PLAY_VERSION}
      LOCAL_REPO=${HOME}/play-${PLAY_VERSION}/repository/local/com.typesafe.play/play_${SCALA_VERSION}/${PLAY_VERSION}
      mkdir ${LOCAL_REPO}/srcs/ ${LOCAL_REPO}/poms/
      wget ${MAVEN_PLAY}.pom --output-document ${LOCAL_REPO}/poms/play_${SCALA_VERSION}.pom
      wget ${MAVEN_PLAY}-sources.jar --output-document ${LOCAL_REPO}/srcs/play_${SCALA_VERSION}-sources.jar
      wget ${MAVEN_PLAY}-test-sources.jar --output-document ${LOCAL_REPO}/srcs/play_${SCALA_VERSION}-test-sources.jar

OTHER TIPS

I suppose the Typesafe repository is missing.

Check your project/plugins.sbt, tipically it contains the sbt-plugin inclusion and the needed typesafe repo resolution:

// The Typesafe repository
resolvers += "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.1")

please update your dependencies to use swagger-play2-1.3.3:

"com.wordnik" %% "swagger-play2" % "1.3.3"

I hackily fixed build by manually downloading all the jars in my travis build script. But, I doubt that is the real solution - it seems adding swagger-play2 assumes some jars to be in a particular directory and never resolves to anywhere else...

Swagger 1.3.1 works with Play 2.2.1 for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top