2015-04-29 212 views
2

這是我寫SBT未解決的依賴

name := "Introduction" 

version := "1.0" 

scalaVersion := "2.11.2" 

resolvers ++= Seq(
    "snapshots" at "http://oss.sonatype.org/content/repositories/snapshots", 
    "releases" at "http://oss.sonatype.org/content/repositories/releases" 
    ) 

libraryDependencies ++= Seq("org.specs2" %% "specs2" % "1.12.3" % "test") 

當我運行sbt compile我收到錯誤消息的SBT構建文件

[info] Resolving org.specs2#spec2_2.11;1.12.3 ... 
[warn] module not found: org.specs2#spec2_2.11;1.12.3 
[warn] ==== local: tried 
[warn] C:\Users\Abhishek\.ivy2\local\org.specs2\spec2_2.11\1.12.3\ivys\ivy.xml 
[warn] ==== public: tried 
[warn] https://repo1.maven.org/maven2/org/specs2/spec2_2.11/1.12.3/spec2_2.11-1.12.3.pom 
[warn] ==== snapshots: tried 
[warn] http://oss.sonatype.org/content/repositories/snapshots/org/specs2/spec2_2.11/1.12.3/spec2_2.11-1.12.3.pom 
[warn] ==== releases: tried 
[warn] http://oss.sonatype.org/content/repositories/releases/org/specs2/spec2_2.11/1.12.3/spec2_2.11-1.12.3.pom 
[info] Resolving jline#jline;2.12 ... 
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.2/scala-library-2.11.2.jar ... 
[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.11.2!scala-library.jar (1827ms) 
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.2/scala-compiler-2.11.2.jar ... 
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.11.2!scala-compiler.jar (3875ms) 
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.2/scala-reflect-2.11.2.jar ... 
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.2!scala-reflect.jar (1375ms) 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] ::   UNRESOLVED DEPENDENCIES   :: 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] :: org.specs2#spec2_2.11;1.12.3: not found 
[warn] :::::::::::::::::::::::::::::::::::::::::::::: 
[warn] 
[warn] Note: Unresolved dependencies path: 
[warn]   org.specs2:spec2_2.11:1.12.3 (D:\myapps\Scala\hw\build.sbt#L12-13) 
[warn]   +- introduction:introduction_2.11:1.0 
+2

那是相當的舊的specs2版本(2.5年)。它尚未發佈爲scala 2.11。 –

回答

1

使用:

libraryDependencies += "org.specs2" % "specs2_2.11.0-RC3" % "2.3.10" 
+1

是的,這是有效的。你是如何找到正確答案的? –

+1

基於你的Scala版本,並在maven倉庫中搜索:http://mvnrepository.com/artifact/org.specs2/specs2_2.11.0-RC3/2.3.10:) – chengpohi

+2

你需要知道scala版本是一件棘手的事情。 – chengpohi