2017-04-12 56 views
0

我有一個十字架上爲2.11建起了斯卡拉項目和2.12爲什麼ScalaTest 3.0.1 for 2.12沒有解決?

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] :::::::::::::::::::::::::::::::::::::::::::::: 

任何指向這裏缺少的指針?

UPDATE: 添加我的〜/名.bst /庫設置

[倉庫]

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

根據你的日誌,SBT不會搜索對Maven Central的依賴(可能是因爲你的全局SBT配置改變了默認的解析器?)。您需要添加Maven Central作爲解析器,或者確保Scalatest依賴項可以從您組織的某個回購站中解析(artifactory.internal.com/maven-releases我猜)。 –

+0

你說得對。當我將maven中心添加到build.sbt時,它可以工作。 我已經將我的〜/ .sbt/repositories設置爲指向artifactory。這是最近的一次變化。我認爲artifactory maven-proxy-releases默認會查看Maven Central。有些東西與我們的artifactory配置不符? – Cheeko

+0

使用我的存儲庫文件更新後的文章 – Cheeko

回答

1

根據你的日誌,SBT不搜索Maven的中央,依賴其是Scalatest最直接的地方。這對於默認的SBT配置不是問題(因爲Maven Central是默認的解析器之一);但在這裏,您有一個特定的SBT配置,以便使用貴組織的內部回購協議(在http://artifactory.internal.com上)。

您需要在您的SBT解析器中添加Maven Central(但這可能不是您想要的,從長遠來看),或者檢查您的Artifactory管理員,如果artifactory.internal.com/maven-releases repo是應該代理Maven Central依賴項的那個,並且它是否正確配置。我認爲他們也應該能夠從Artifactory中導出一個指向您需要使用的回購站的Maven配置文件:然後您可以將這些URL複製並粘貼到您的SBT配置文件中。

相關問題