简体   繁体   English

IntelliJ IDEA 2018.3 Scala 2.12 SBT 1.0程序集未解决的依赖项

[英]IntelliJ IDEA 2018.3 scala 2.12 sbt 1.0 assembly unresolved dependencies

I am new to IntelliJ IDEA, Scala, sbt etc. I am just trying to set up my project with no code yet, added the library dependencies and added the assembly.sbt to create the fat / uber jar. 我是IntelliJ IDEA,Scala,sbt等的新手。我只是想建立尚无代码的项目,添加库依赖项,并添加assembly.sbt来创建fat / uber jar。 Here are my details, but I get unresolved dependencies issue with SSLHandshakeException. 这是我的详细信息,但是我遇到了SSLHandshakeException无法解决的依赖项问题。

chose the following while setting up project sbt version: 1.2.3 scala version : 2.11.8, 在设置项目sbt版本时选择了以下内容:1.2.3 scala版本:2.11.8,

build.sbt build.sbt

name := "untitled4"

version := "0.1"

scalaVersion := "2.11.8"

libraryDependencies += "org.apache.spark" %% "spark-core" % "2.3.0" % "provided"
libraryDependencies += "org.apache.spark" %% "spark-sql" % "2.3.0" % "provided"

assemblyMergeStrategy in assembly := {
  case PathList("META-INF", xs @ _*) => MergeStrategy.discard
  case x => MergeStrategy.first
}

build.properties build.properties

sbt.version = 1.2.3

assembly.sbt under project/ 项目/下的assembly.sbt

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

I don't understand two things, why does it defaults to scala 2.12 and sbt 1.0 (see stack trace below) and why the unresolved dependencies error. 我不明白两件事,为什么它默认为scala 2.12和sbt 1.0(请参阅下面的堆栈跟踪)以及为什么未解决的依赖项错误。

I have tried adding certificates to my keystore thinking it might be that with no success. 我曾尝试向我的密钥库添加证书,以为可能没有成功。

i also tried to access both the url's it provides in the stack trace below, and i get this error "The requested path was not found." 我也尝试访问下面堆栈跟踪中提供的两个URL,并且出现此错误“找不到请求的路径”。

stacktrace Error while importing sbt project: 导入sbt项目时出现stacktrace错误:

[info] Loading global plugins from C:\Users\xxxxx\.sbt\1.0\plugins
[info] Loading settings for project untitled4-build from assembly.sbt ...
[info] Loading project definition from C:\Users\xxxxx\IdeaProjects\untitled4\project
[info] Updating ProjectRef(uri("file:/C:/Users/xxxxx/IdeaProjects/untitled4/project/"), "untitled4-build")...

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.eed3si9n#sbt-assembly;0.14.6: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.6 {compile=[default(compile)]}::
[warn]  typesafe-ivy-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.6: res=https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.6/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
[warn]  sbt-plugin-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.6: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.6/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
[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.6 (scalaVersion=2.12, sbtVersion=1.0)
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      com.eed3si9n:sbt-assembly:0.14.6 (scalaVersion=2.12, sbtVersion=1.0) (C:\Users\xxxxx\IdeaProjects\untitled4\project\assembly.sbt#L1-2)
[warn]        +- default:untitled4-build:0.1.0-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[error] sbt.librarymanagement.ResolveException: unresolved dependency: com.eed3si9n#sbt-assembly;0.14.6: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.6 {compile=[default(compile)]}::
[error]     typesafe-ivy-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.6: res=https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.6/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.6: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.6/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]
[error]     at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:332)
[error]     at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:208)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:239)
[error]     at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:204)
[error]     at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[error]     at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[error]     at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
[error]     at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
[error]     at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
[error]     at xsbt.boot.Using$.withResource(Using.scala:10)
[error]     at xsbt.boot.Using$.apply(Using.scala:9)
[error]     at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error]     at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error]     at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error]     at xsbt.boot.Locks$.apply(Locks.scala:28)
[error]     at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[error]     at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:199)
[error]     at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:196)
[error]     at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:238)
[error]     at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:193)
[error]     at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[error]     at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[error]     at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:45)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:93)
[error]     at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:106)
[error]     at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:106)
[error]     at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:89)
[error]     at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149)
[error]     at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:120)
[error]     at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2550)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error]     at sbt.std.Transform$$anon$4.work(System.scala:67)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]     at sbt.Execute.work(Execute.scala:278)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]     at java.lang.Thread.run(Thread.java:748)
[error] (update) sbt.librarymanagement.ResolveException: unresolved dependency: com.eed3si9n#sbt-assembly;0.14.6: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.6 {compile=[default(compile)]}::
[error]     typesafe-ivy-releases: unable to get resource for com.eed3si9n#sbt-assembly;0.14.6: res=https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.6/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.6: res=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.14.6/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
Invalid response.

One confusion here is the Scala version with which sbt itself runs, and the version of your project. 这里的一个困惑是sbt本身可以运行的Scala版本以及项目的版本。 sbt 1.x runs on Scala 2.12, that is why you are getting a message that shows this version. sbt 1.x在Scala 2.12上运行,这就是为什么您收到显示此版本的消息的原因。

The next confusion is between "binary compatibility" version of sbt and the one you are running. 下一个困惑是sbt的“二进制兼容性”版本与您正在运行的版本之间。 All 1.x versions of sbt have the "binary" version 1.0. sbt的所有1.x版本都具有“二进制”版本1.0。

The actual error here is this part: 这里的实际错误是这部分:

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 could be because your JDK and the included SSL certificates are out of date. 这可能是因为您的JDK和随附的SSL证书已过期。 Which JDK are you running and does upgrading to a current release of JDK8 help? 您正在运行哪个JDK,升级到最新版本的JDK8是否有帮助?

Add this resolver to your assembly.sbt 将此解析器添加到您的assembly.sbt

resolvers += Resolver.bintrayIvyRepo("com.eed3si9n", "sbt-plugins")

Also, add this line your merge strategy in case you are using any configuration(.conf) files 另外,如果您正在使用任何配置(.conf)文件,请将此行添加为合并策略

case "reference.conf" => MergeStrategy.concat

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM