2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Play Framework] sbt.ResolveException: unresolved dependency:org.scalaz.stream#scalaz-stream_2.11;0.7a: not found について

Posted at

JCenterのCloseに伴う Play Framework の Build Error

Play Flamework で構成されたアプリケーションの改修に着手した際、下記のDependency Errorにより起動ができない状況でした。

[error] (*:update) sbt.ResolveException: unresolved dependency:org.scalaz.stream#scalaz-stream_2.11;0.7a: not found

調査の結果、build.sbt 内で scalaz package の依存関係の取得元に指定されていた、Bintrayが5/1以降Closeしていたことに起因していました。

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"

BintrayのCloseについて(ブラウザで叩いても403が帰ってくる: http://dl.bintray.com/scalaz/releases)
5月1日のBintray、JCenter、GoCenter、ChartCenterのサービス終了について: https://jfrog.com/ja/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/

対応

今回エラーの原因になっている org.scalaz.stream package の バージョン 0.7a は、 playframework内のテスト用package specs2 が依存先となっているようでした。

playframeworkのバージョンを上げるか、playframeworkの内部を見て、specs2 のバージョンを上げることで、依存先の org.scalaz.stream のバージョンを上げるという対応は難しそうだったので、

org.scalaz.stream のみ、依存しているversionを上書きするという対応を取りました。

- resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
+ dependencyOverrides += "org.scalaz.stream" %% "scalaz-stream" % "0.7.2"

dependencyOverrides option について: https://www.scala-sbt.org/1.x/docs/Library-Management.html#Overriding+a+version
※ 0.7.2 以降であれば、Maven Central に packageがアップロードされているため、sbt が依存関係を解決する際に接続する Maven Central 参照時に依存関係を正常に取得できる。それ以前のversionは Maven Central にUploadされていない。(Imageは、Maven Central 内から取得できる scalaz)

image (16).png

備考

sbtが依存関係を解消するときには参照順がある: https://takezoe.hatenablog.com/entry/20121201/p1

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?