簡體   English   中英

sbt->compile 后找不到 org.scalacheck 和 org.scalatest

[英]org.scalacheck and org.scalatest not found after sbt->compile

[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scalatest#scalatest_2.12;2.2.4: not found
[error] unresolved dependency: org.scalacheck#scalacheck_2.12;1.12.1: not found
[error] unresolved dependency: org.scalactic#scalatest;3.0.1: not found
[error] unresolved dependency: org.scalacheck#scalacheck;1.13.4: not found
[error] unresolved dependency: org.scalatest#scalatest;3.0.1: not found

在 scala-2.12.1/lib/ 中存在以下文件: scalacheck_2.12-1.13.4.jar scalactic_2.11-3.0.1.jar scalatest_2.11-3.0.1.jar

在 build.sbt 中包含:

scalaVersion := "2.12.1"
libraryDependencies += "junit" % "junit" % "4.10" % "test"
libraryDependencies ++= assignmentsMap.value.values.flatMap(_.dependencies).toSeq
libraryDependencies += "org.scalacheck" % "scalacheck" % "1.13.4" % "test"
libraryDependencies += "org.scalactic" % "scalatest" % "3.0.1"
libraryDependencies += "org.scalatest" % "scalatest" % "3.0.1" % "test"

但是$ sbt然后編譯報錯:scala> developer@cn-vm-yourname:~/example/quickcheck$ sbt [info] Loading global plugins from /home/developer/.sbt/0.13/plugins [info] Loading project定義來自 /home/developer/example/quickcheck/project [info] 將當前項目設置為 progfun2-quickcheck(在構建文件中:/home/developer/example/quickcheck/)

編譯

[info] Updating {file:/home/developer/example/quickcheck/}root...
[info] Resolving org.scalatest#scalatest_2.12;2.2.4 ...
[warn]  module not found: org.scalatest#scalatest_2.12;2.2.4
[warn] ==== local: tried
[warn]   /home/developer/.ivy2/local/org.scalatest/scalatest_2.12/2.2.4/ivys/ivy.xml
[warn] ==== activator-launcher-local: tried
[warn]   /home/developer/.activator/repository/org.scalatest/scalatest_2.12/2.2.4/ivys/ivy.xml
[warn] ==== activator-local: tried
[warn]   /home/developer/activator-dist-1.3.12/repository/org.scalatest/scalatest_2.12/2.2.4/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scalatest/scalatest_2.12/2.2.4/scalatest_2.12-2.2.4.pom
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest_2.12/2.2.4/scalatest_2.12-2.2.4.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scalatest/scalatest_2.12/2.2.4/ivys/ivy.xml
[info] Resolving org.scalacheck#scalacheck_2.12;1.12.1 ...
[warn]  module not found: org.scalacheck#scalacheck_2.12;1.12.1
[warn] ==== local: tried
[warn]   /home/developer/.ivy2/local/org.scalacheck/scalacheck_2.12/1.12.1/ivys/ivy.xml
[warn] ==== activator-launcher-local: tried
[warn]   /home/developer/.activator/repository/org.scalacheck/scalacheck_2.12/1.12.1/ivys/ivy.xml
[warn] ==== activator-local: tried
[warn]   /home/developer/activator-dist-1.3.12/repository/org.scalacheck/scalacheck_2.12/1.12.1/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scalacheck/scalacheck_2.12/1.12.1/scalacheck_2.12-1.12.1.pom
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scalacheck/scalacheck_2.12/1.12.1/scalacheck_2.12-1.12.1.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scalacheck/scalacheck_2.12/1.12.1/ivys/ivy.xml
[info] Resolving org.scalactic#scalatest;3.0.1 ...
[warn]  module not found: org.scalactic#scalatest;3.0.1
[warn] ==== local: tried
[warn]   /home/developer/.ivy2/local/org.scalactic/scalatest/3.0.1/ivys/ivy.xml
[warn] ==== activator-launcher-local: tried
[warn]   /home/developer/.activator/repository/org.scalactic/scalatest/3.0.1/ivys/ivy.xml
[warn] ==== activator-local: tried
[warn]   /home/developer/activator-dist-1.3.12/repository/org.scalactic/scalatest/3.0.1/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scalactic/scalatest/3.0.1/scalatest-3.0.1.pom
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scalactic/scalatest/3.0.1/scalatest-3.0.1.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scalactic/scalatest/3.0.1/ivys/ivy.xml
[info] Resolving org.scalacheck#scalacheck;1.13.4 ...
[warn]  module not found: org.scalacheck#scalacheck;1.13.4
[warn] ==== local: tried
[warn]   /home/developer/.ivy2/local/org.scalacheck/scalacheck/1.13.4/ivys/ivy.xml
[warn] ==== activator-launcher-local: tried
[warn]   /home/developer/.activator/repository/org.scalacheck/scalacheck/1.13.4/ivys/ivy.xml
[warn] ==== activator-local: tried
[warn]   /home/developer/activator-dist-1.3.12/repository/org.scalacheck/scalacheck/1.13.4/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scalacheck/scalacheck/1.13.4/scalacheck-1.13.4.pom
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scalacheck/scalacheck/1.13.4/scalacheck-1.13.4.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scalacheck/scalacheck/1.13.4/ivys/ivy.xml
[info] Resolving org.scalatest#scalatest;3.0.1 ...
[warn]  module not found: org.scalatest#scalatest;3.0.1
[warn] ==== local: tried
[warn]   /home/developer/.ivy2/local/org.scalatest/scalatest/3.0.1/ivys/ivy.xml
[warn] ==== activator-launcher-local: tried
[warn]   /home/developer/.activator/repository/org.scalatest/scalatest/3.0.1/ivys/ivy.xml
[warn] ==== activator-local: tried
[warn]   /home/developer/activator-dist-1.3.12/repository/org.scalatest/scalatest/3.0.1/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scalatest/scalatest/3.0.1/scalatest-3.0.1.pom
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scalatest/scalatest/3.0.1/scalatest-3.0.1.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scalatest/scalatest/3.0.1/ivys/ivy.xml
[info] Resolving jline#jline;2.14.1 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scalatest#scalatest_2.12;2.2.4: not found
[warn]  :: org.scalacheck#scalacheck_2.12;1.12.1: not found
[warn]  :: org.scalactic#scalatest;3.0.1: not found
[warn]  :: org.scalacheck#scalacheck;1.13.4: not found
[warn]  :: org.scalatest#scalatest;3.0.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      org.scalatest:scalatest_2.12:2.2.4 (/home/developer/example/quickcheck/project/StudentBuildLike.scala#L27)
[warn]        +- progfun2-quickcheck:progfun2-quickcheck_2.12:0.1-SNAPSHOT
[warn]      org.scalactic:scalatest:3.0.1 (/home/developer/example/quickcheck/build.sbt#L11-12)
[warn]        +- progfun2-quickcheck:progfun2-quickcheck_2.12:0.1-SNAPSHOT
[warn]      org.scalacheck:scalacheck:1.13.4 (/home/developer/example/quickcheck/build.sbt#L10-11)
[warn]        +- progfun2-quickcheck:progfun2-quickcheck_2.12:0.1-SNAPSHOT
[warn]      org.scalatest:scalatest:3.0.1 (/home/developer/example/quickcheck/build.sbt#L12-13)
[warn]        +- progfun2-quickcheck:progfun2-quickcheck_2.12:0.1-SNAPSHOT
[warn]      org.scalacheck:scalacheck_2.12:1.12.1 (/home/developer/example/quickcheck/build.sbt#L9-10)
[warn]        +- progfun2-quickcheck:progfun2-quickcheck_2.12:0.1-SNAPSHOT
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scalatest#scalatest_2.12;2.2.4: not found
[error] unresolved dependency: org.scalacheck#scalacheck_2.12;1.12.1: not found
[error] unresolved dependency: org.scalactic#scalatest;3.0.1: not found
[error] unresolved dependency: org.scalacheck#scalacheck;1.13.4: not found
[error] unresolved dependency: org.scalatest#scalatest;3.0.1: not found

嘗試從 build.sbt 中刪除此行:

libraryDependencies += "org.scalactic" % "scalatest" % "3.0.1"

在 plugins.sbt 文件中確保 sbt-plugin 版本大於或等於 2.3.8

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM