“不支持不安全的 HTTP 请求”Scala 中的错误
我在尝试运行Scala代码时收到以下错误:sbt run
insecure HTTP request is unsupported 'http://repo.typesafe.com/typesafe/releases'; switch to HTTPS or opt-in as ("typesafe-releases" at "http://repo.typesafe.com/typesafe/releases").withAllowInsecureProtocol(true), or by using allowInsecureProtocol in repositories file
这很奇怪,因为它上周工作得很好,我没有在代码中做任何更改。我尝试添加我的文件和解析器文件,安装Java11,删除我的项目文件夹,并从存储库中完全重新克隆我的代码,但没有任何工作。我正在使用Visual Studios,但也尝试过IntelliJ并得到相同的错误。("typesafe-releases" at "http://repo.typesafe.com/typesafe/releases").withAllowInsecureProtocol(true)
build.sbt
任何建议将不胜感激,因为我没有改变任何东西,现在突然我的代码不再编译了。更多详情:
sbt.version = 1.4.0
Scala 代码运行器版本 2.12.10
我目前的build.sbt(请注意,当我的代码工作正常时,我之前没有添加解析部分。它被添加为试图解决问题,但不起作用):
scalaVersion := "2.12.10"
name := "name"
organization := "org"
version := "1.0"
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2",
"org.apache.spark" %% "spark-core" % "3.0.1",
"org.apache.spark" %% "spark-sql" % "3.0.1",
"org.reactivemongo" %% "reactivemongo-bson-api" % "0.20.11",
"org.mongodb.spark" %% "mongo-spark-connector" % "3.0.0",
"com.ibm.db2.jcc" % "db2jcc" % "db2jcc4"
)
resolvers += Resolver.typesafeRepo("releases")
编辑:我发现无论项目如何,都会发生此错误,甚至当我自己运行sbt时也会发生此错误。