为什么ScalaTest 3.0.1 for 2.12无法解决?

时间:2017-04-12 09:13:44

标签: scala sbt scalatest

我有一个为2.11和2.12交叉构建的scala项目

  

crossScalaVersions:= Seq(" 2.11.8"," 2.12.0")

我已经添加了对scalatest的依赖。

libraryDependencies ++= Seq(
  "org.scalatest"            %% "scalatest"           % "3.0.1"    % "test",
  "org.mockito"              % "mockito-all"          % "1.10.19"  % "test"
)
resolvers ++= Seq(
  "Akka"       at    "http://akka.io/repository/",
  "Sonatype"   at    "http://oss.sonatype.org/content/repositories/releases"
)

我可以看到2.12版本是published,对于3.0.0的scalatest。 SBT无法解决这个问题。

[warn] ==== sbt-releases-repo: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scalatest/scalatest_2.12/3.0.1/ivys/ivy.xml
[warn] ==== sbt-plugins-repo: tried
[warn]   http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.scalatest/scalatest_2.12/3.0.1/ivys/ivy.xml
[warn] ==== my-ivy-proxy-releases: tried
[warn]   http://artifactory.internal.com/ivy-releases/org.scalatest/scalatest_2.12/3.0.1/ivys/ivy.xml
[warn] ==== my-maven-proxy-releases: tried
[warn]   http://artifactory.internal.com/maven-releases/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1.pom [warn] ==== Akka: tried
[warn]   http://akka.io/repository/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1.pom
[warn] ==== Sonatype: tried
[warn]   http://oss.sonatype.org/content/repositories/releases/org/scalatest/scalatest_2.12/3.0.1/scalatest_2.12-3.0.1.pom [info] Resolving jline#jline;2.14.1 ...

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::      UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scalatest#scalatest_2.12;3.0.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

指向这里缺少什么的指针?

更新 添加我的〜/ .sbt /存储库设置

[库]

local  
my-ivy-proxy-releases: http://artifactory.internal.com/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]
my-maven-proxy-releases: http://artifactory.internal.com/maven-releases/

1 个答案:

答案 0 :(得分:1)

根据你的日志,SBT没有搜索对Maven Central的依赖,这是从Scalatest获取最直接的地方。这不是默认SBT配置的问题(因为Maven Central是默认的解析器之一);但是在这里,您有一个特定的SBT配置,以改为使用您组织的内部存储库(http://artifactory.internal.com)。

你需要在你的SBT解析器中添加Maven Central(但从长远来看,这可能不是你想要的)或者如果artifactory.internal.com/maven-releases repo是&=IIF(Len(Fields!groupX.Value) > 20,Left(Fields!groupX.Value,20) + "...",Fields!groupX.Value) repo,请与你的Artifactory管理员联系。 #39; s应该代理Maven Central依赖项,如果它已正确配置。我认为他们也应该能够从Artifactory导出一个指向您需要使用的存储库的Maven配置文件:然后您可以将其中的URL复制并粘贴到您的SBT配置文件中。