2014-01-26 60 views
3

我創建了一個sandbox play project進行測試。 Travis CIbuilding and passing the tests。我加在swagger-play2的依賴,並開始失敗與錯誤信息的測試:Scala Play項目在添加swagger-play2依賴項後失敗build - sbt找不到play?

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

重現步驟:

  1. 加入招搖
  2. Addingswaggerbuild.sbt
  3. 之前創建 default play scala project
  4. Build passes
  5. 立即開始fails :(
  6. Remove招搖依賴
  7. 現在構建passes了!

似乎很奇怪,在swagger上添加依賴會觸發此構建失敗。我究竟做錯了什麼?隨意發送的,如果你想測試你的修改((特拉維斯應該自動建立你拉的請求)的github project pull請求

完全GitHub上項目的歷史。https://github.com/pathikrit/play-test/commits/master

完全特拉維斯-CI構建歷史:https://travis-ci.org/pathikrit/play-test/builds

凱明觸發建立失敗:https://github.com/pathikrit/play-test/commit/d8ad88083b56dd0269eaefc30025a42f54f0dba5

+0

我無法在我的個人Macbook上重現此操作。無論是因爲我安裝遊戲的不同方式(「brew install play」vs [Travis's manual script](https://github.com/pathikrit/play-test/blob/master/.travis.yml)),還是因爲本地常春藤/ m2/play caches?我如何徹底刪除所有本地玩jar高速緩存,以便強制重新安裝?有什麼其他原因會使這個bug僅出現在Travis中,而不是在本地? – pathikrit

回答

1

我現在有一個腳本來建立依賴關係:

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 
3

我想類型安全庫丟失

章埃克項目/ plugins.sbt,tipically它包含了SBT-plugin的包容性和所需要的類型安全回購的決議:

// 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") 
+0

不,我在'project/plugins .sbt' - 請看看[這裏](https://github.com/pathikrit/play-test/tree/master/project) – pathikrit

1

請更新您的依賴使用swagger-play2-1.3.3:

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

Nopes,仍然失敗 – pathikrit

+0

優秀 - 這種依賴對我有用! –

相關問題