为sbt提取项目

extracting project for sbt

我最近经常遇到以下错误。当我尝试将库依赖项添加到 sbt 时会发生这种情况。在下面的例子中,我尝试添加

"org.tpolecat" %% "doobie-postgres" % "0.8.8",
"org.tpolecat" %% "doobie-postgres-circe" % "0.8.8",

我正在使用 Java 1.8 SDK 和 scala-sdk-2.13.3

我最近买了一台新的 macbook 并下载了 IntelliJ,也许我没有正确设置它。我还尝试将所有 doobie 依赖项的版本号更改为 0.8.8,但这也没有帮助。

name := "job-board"

version := "1.0"

scalaVersion := "2.11.7"

libraryDependencies ++= {

  lazy val doobieVersion = "0.5.4"
  lazy val http4sVersion = "0.20.8"
  lazy val circeVersion = "0.9.1"

  Seq(
    "org.tpolecat" %% "doobie-postgres" % "0.8.8",
    "org.tpolecat" %% "doobie-postgres-circe" % "0.8.8",
    "org.tpolecat" %% "doobie-core" % doobieVersion,
    "org.tpolecat" %% "doobie-h2" % doobieVersion,
    "org.tpolecat" %% "doobie-hikari" % doobieVersion,
    "org.tpolecat" %% "doobie-specs2" % doobieVersion,
    "org.http4s" %% "http4s-blaze-server" % http4sVersion,
    "org.http4s" %% "http4s-circe" % http4sVersion,
    "org.http4s" %% "http4s-dsl" % http4sVersion,
    "io.circe" %% "circe-core" % circeVersion,
    "io.circe" %% "circe-generic" % circeVersion,
    "io.circe" %% "circe-config" % "0.6.1",
    "mysql" % "mysql-connector-java" % "5.1.34",
    "org.slf4j" % "slf4j-api" % "1.7.5",
    "ch.qos.logback" % "logback-classic" % "1.0.9"
  )

}

resolvers ++= Seq(
  "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
)

/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java -Djline.terminal=jline.UnsupportedTerminal -Dsbt.log.noformat=true -Dfile.encoding=UTF-8 -Didea.managed=true -Dfile.encoding=UTF-8 -jar /Users/ryanmcavoy/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/202.6397.94/IntelliJ IDEA CE.app.plugins/Scala/launcher/sbt-launch.jar
[info] welcome to sbt 1.3.13 (AdoptOpenJDK Java 1.8.0_262)
[info] loading global plugins from /Users/ryanmcavoy/.sbt/1.0/plugins
[info] loading project definition from /Users/ryanmcavoy/Code/job-board/project
[info] loading settings for project job-board from build.sbt ...
[info] set current project to job-board (in build file:/Users/ryanmcavoy/Code/job-board/)
[warn] sbt server could not start because there's another instance of sbt running on this build.
[warn] Running multiple instances is unsupported
sbt:job-board>
[info] Defining Global / sbtStructureOptions, Global / sbtStructureOutputFile and 1 others.
[info] The new values will be used by cleanKeepGlobs
[info]  Run `last` for details.
[info] Reapplying settings...
[info] set current project to job-board (in build file:/Users/ryanmcavoy/Code/job-board/)
[info] Applying State transformations org.jetbrains.sbt.CreateTasks from /Users/ryanmcavoy/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/202.6397.94/IntelliJ IDEA CE.app.plugins/Scala/repo/org.jetbrains/sbt-structure-extractor/scala_2.12/sbt_1.0/2018.2.1+4-88400d3f/jars/sbt-structure-extractor.jar
[info] Reapplying settings...
[info] set current project to job-board (in build file:/Users/ryanmcavoy/Code/job-board/)
[warn] insecure HTTP request is deprecated 'http://repo.typesafe.com/typesafe/releases/'; switch to HTTPS or opt-in as ("Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/").withAllowInsecureProtocol(true)
[warn]
[warn]  Note: Unresolved dependencies path:
[error] stack trace is suppressed; run 'last update' for the full output
[error] stack trace is suppressed; run 'last ssExtractDependencies' for the full output
[error] (update) sbt.librarymanagement.ResolveException: Error downloading org.tpolecat:doobie-postgres_2.11:0.8.8
[error]   Not found
[error]   Not found
[error]   not found: /Users/ryanmcavoy/.ivy2/local/org.tpolecat/doobie-postgres_2.11/0.8.8/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/tpolecat/doobie-postgres_2.11/0.8.8/doobie-postgres_2.11-0.8.8.pom
[error]   download error: Caught java.net.ConnectException: Connection refused (Connection refused) (Connection refused (Connection refused)) while downloading http://repo.typesafe.com/typesafe/releases/org/tpolecat/doobie-postgres_2.11/0.8.8/doobie-postgres_2.11-0.8.8.pom
[error] Error downloading org.tpolecat:doobie-postgres-circe_2.11:0.8.8
[error]   Not found
[error]   Not found
[error]   not found: /Users/ryanmcavoy/.ivy2/local/org.tpolecat/doobie-postgres-circe_2.11/0.8.8/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/tpolecat/doobie-postgres-circe_2.11/0.8.8/doobie-postgres-circe_2.11-0.8.8.pom
[error]   download error: Caught java.net.ConnectException: Connection refused (Connection refused) (Connection refused (Connection refused)) while downloading http://repo.typesafe.com/typesafe/releases/org/tpolecat/doobie-postgres-circe_2.11/0.8.8/doobie-postgres-circe_2.11-0.8.8.pom
[error] (ssExtractDependencies) sbt.librarymanagement.ResolveException: Error downloading org.tpolecat:doobie-postgres_2.11:0.8.8
[error]   Not found
[error]   Not found
[error]   not found: /Users/ryanmcavoy/.ivy2/local/org.tpolecat/doobie-postgres_2.11/0.8.8/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/tpolecat/doobie-postgres_2.11/0.8.8/doobie-postgres_2.11-0.8.8.pom
[error]   download error: Caught java.net.ConnectException: Connection refused (Connection refused) (Connection refused (Connection refused)) while downloading http://repo.typesafe.com/typesafe/releases/org/tpolecat/doobie-postgres_2.11/0.8.8/doobie-postgres_2.11-0.8.8.pom
[error] Error downloading org.tpolecat:doobie-postgres-circe_2.11:0.8.8
[error]   Not found
[error]   Not found
[error]   not found: /Users/ryanmcavoy/.ivy2/local/org.tpolecat/doobie-postgres-circe_2.11/0.8.8/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/tpolecat/doobie-postgres-circe_2.11/0.8.8/doobie-postgres-circe_2.11-0.8.8.pom
[error]   download error: Caught java.net.ConnectException: Connection refused (Connection refused) (Connection refused (Connection refused)) while downloading http://repo.typesafe.com/typesafe/releases/org/tpolecat/doobie-postgres-circe_2.11/0.8.8/doobie-postgres-circe_2.11-0.8.8.pom
[error] Total time: 1 s, completed Aug 10, 2020 1:48:01 PM

I'm using Java 1.8 SDK and scala-sdk-2.13.3

您没有使用 Scala 2.13.3,因为它写成

scalaVersion := "2.11.7"

Scala 2.11

没有 doobie-postgres 0.8.8

https://mvnrepository.com/artifact/org.tpolecat/doobie-postgres