3

I have a fairly minimal example SBT project.

In particular, this is my project/plugins.sbt:

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")

And this is my project/build.properties:

sbt.version = 1.2.8

The error I get in SBT when loading my project starts off like this:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.eed3si9n#sbt-assembly;0.14.9: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.9 {compile=[default(compile)]}::
[warn]  typesafe-ivy-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.9: res=https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.9/ivys/ivy
.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certificat
ion path to requested target
[warn]  sbt-plugin-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.9: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.9/iv
ys/ivy.xml: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid cert
ification path to requested target
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]          com.eed3si9n:sbt-assembly:0.14.9 (scalaVersion=2.12, sbtVersion=1.0)
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]          com.eed3si9n:sbt-assembly:0.14.9 (scalaVersion=2.12, sbtVersion=1.0) (/Users/dah/vc/noddy-akka-http/project/plugins.sbt#L1-2)
[warn]            +- default:noddy-akka-http-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)

and ends

[error] (update) sbt.librarymanagement.ResolveException: unresolved dependency: com.eed3si9n#sbt-assembly;0.14.9: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.9 {compile=
[default(compile)]}::
[error]         typesafe-ivy-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.9: res=https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.9/
ivys/ivy.xml: 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
[error]         sbt-plugin-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.9: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.9/ivys/ivy.xml: 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

This is the version of the JVM I have installed:

$ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)

Although, when I run sbt console (from a directory without an SBT project), I get:

Welcome to Scala version 2.10.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_31).
Type in expressions to have them evaluated.
Type :help for more information.

I have macOS Mojave 10.14.5.

I assume I need to update my certificate store. How would I go about doing that?

Or should I be doing something else to fix this?

dave4420
  • 46,404
  • 6
  • 118
  • 152
  • 1
    It works on my machine, macOS 10.14.3, Java 1.8.0_202. Note your repo is using sbt-assembly `0.14.3` so I had to change it to `0.14.9`. – Mario Galic Jul 01 '19 at 20:26
  • Argh, sorry, yes, was playing around trying to use different versions of sbt-assembly, with no success, ended up committing an earlier version. Have amended my question to point to a later commit referencing 0.14.9. – dave4420 Jul 01 '19 at 20:34
  • Are you behind a proxy? – Mario Galic Jul 01 '19 at 20:35
  • I'm not behind a proxy as far as I know (and this is using my home internet connection, I'll be pissed off if I am behind an intercepting proxy). – dave4420 Jul 01 '19 at 20:41
  • Just to double check java version used by sbt, can you execute `sbt console`. It should say something like `Welcome to Scala 2.12.7 (OpenJDK 64-Bit Server VM, Java 1.8.0_202).` – Mario Galic Jul 01 '19 at 21:18
  • See edit. That's odd… (no time to investigate further right now as I have to get to work) – dave4420 Jul 02 '19 at 06:34
  • It does seem you have multiple java versions installed. Personally, I would suggest cleaning that up and look into `brew cask info adoptopenjdk8`. – Mario Galic Jul 02 '19 at 09:28
  • @MarioGalic I [uninstalled Oracle JDK](https://stackoverflow.com/questions/19039752/removing-java-8-jdk-from-mac), then [installed OpenJDK](https://adoptopenjdk.net), and now SBT loads my project :-) Please add an answer suggesting to double check the version of java used by SBT, so I can accept it. – dave4420 Jul 02 '19 at 21:12

1 Answers1

1

Double check java version used by sbt by executing sbt console. It should say something like Welcome to Scala 2.12.7 (OpenJDK 64-Bit Server VM, Java 1.8.0_202). Personally, I would suggest cleaning up current installation and trying adoptopenjdk8 like so

brew cask install adoptopenjdk8
Mario Galic
  • 47,285
  • 6
  • 56
  • 98