Vidya
Vidya

Reputation: 30310

Errors Upgrading SBT

I am attempting to upgrade my Scala Play Framework application to 2.8, and this involves upgrading SBT to 1.x.

In my build.propeties I have sbt.version=1.3.5

In plugins.sbt I have

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.4")

However, I see the following:

[warn] insecure HTTP request is deprecated 'http://repo.typesafe.com/typesafe/releases'; switch to HTTPS or opt-in as ("typesafe-releases" at "http://repo.typesafe.com/typesafe/releases").withAllowInsecureProtocol(true)
[warn] insecure HTTP request is deprecated 'http://repo.typesafe.com/typesafe/releases'; switch to HTTPS or opt-in as ("typesafe-releases" at "http://repo.typesafe.com/typesafe/releases").withAllowInsecureProtocol(true)
[warn] insecure HTTP request is deprecated 'http://repo.typesafe.com/typesafe/releases'; switch to HTTPS or opt-in as ("typesafe-releases" at "http://repo.typesafe.com/typesafe/releases").withAllowInsecureProtocol(true)
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]      com.typesafe.play:sbt-plugin:2.7.4 (sbtVersion=1.0, scalaVersion=2.12)
[error] sbt.librarymanagement.ResolveException: Error downloading com.typesafe.play:sbt-plugin;sbtVersion=1.0;scalaVersion=2.12:2.7.4
[error]   Not found
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/com/typesafe/play/sbt-plugin_2.12_1.0/2.7.4/sbt-plugin-2.7.4.pom
[error]   not found: /Users/Neil/.ivy2/local/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.4/ivys/ivy.xml
[error]   not found: /Users/Neil/.activator/repository/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.4/ivys/ivy.xml
[error]   not found: /usr/local/activator-1.3.6/repository/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.4/ivys/ivy.xml
[error]   not found: http://dl.bintray.com/heroku/sbt-plugins/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.4/ivys/ivy.xml
[error]   not found: http://dl.bintray.com/neomaclin/maven/com/typesafe/play/sbt-plugin_2.12_1.0/2.7.4/sbt-plugin-2.7.4.pom
[error]   download error: Caught javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.4/ivys/ivy.xml
[error]   download error: Caught javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.12/sbt_1.0/2.7.4/ivys/ivy.xml

Here are my resolvers:

resolvers += Resolver.typesafeRepo("releases")
resolvers += Resolver.typesafeIvyRepo("releases")
resolvers += Resolver.sbtPluginRepo("releases")
resolvers += Resolver.url("heroku-sbt-plugin-releases", url("http://dl.bintray.com/heroku/sbt-plugins/"))(Resolver.ivyStylePatterns)
resolvers += Resolver.bintrayRepo("neomaclin", "maven")

What's causing all these warnings about using https? More importantly, when I look up those ivy.xml files, I get 404s but obviously those PKIX errors in the console. Why am I getting those when I am not behind a proxy? I guess I am using the wrong coordinates, but I can't figure out how they are wrong.

Upvotes: 4

Views: 2365

Answers (2)

Vidya
Vidya

Reputation: 30310

What worked for me was upgrading my JDK to 11 because that version of Java has the certificates in its trust store necessary to make the requests SBT wants to make.

Upvotes: 1

ZDevelop94
ZDevelop94

Reputation: 149

To avoid these errors make sure you have permissions to the repositories you require access to. Furthermore, ensure your sbt credential files contain your credentials used to access these repositories. There are various ways of setting this up, either through IntelliJ preferences > build, Execution, Deployments > sbt or ~/.sbt/.credentials.

Upvotes: 0

Related Questions