Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala SBT可以';即使文件明显存在,也无法在存储库中找到_Scala_Sbt - Fatal编程技术网

Scala SBT可以';即使文件明显存在,也无法在存储库中找到

Scala SBT可以';即使文件明显存在,也无法在存储库中找到,scala,sbt,Scala,Sbt,存储库返回的内容是否有问题?这是我的build.sbt文件: organization := "org.messy" name := "mess" version := "1-SNAPSHOT" scalaVersion := "2.9.1" libraryDependencies ++= Seq( "org.teleal.cling" % "cling-core" % "1.0.5", "org.teleal.cling" % "cling-support" % "1.0.5"

存储库返回的内容是否有问题?这是我的build.sbt文件:

organization := "org.messy"

name := "mess"

version := "1-SNAPSHOT"

scalaVersion := "2.9.1"

libraryDependencies ++= Seq(
  "org.teleal.cling" % "cling-core" % "1.0.5",
  "org.teleal.cling" % "cling-support" % "1.0.5"
)

resolvers ++= Seq(
  "cling" at "http://teleal.org/m2"
)
。。。这就是我得到的错误。这里的teleal.org-URL可以直接在浏览器中打开,但现在有以下问题:

> compile
[info] Updating {file:*************************************************}default-d33f58...
[warn]      module not found: org.teleal.cling#cling-core;1.0.5
[warn] ==== local: tried
[warn]   ********************/.ivy2/local/org.teleal.cling/cling-core/1.0.5/ivys/ivy.xml
[warn]   -- artifact org.teleal.cling#cling-core;1.0.5!cling-core.jar:
[warn]   ********************/.ivy2/local/org.teleal.cling/cling-core/1.0.5/jars/cling-core.jar
[warn] ==== cling: tried
[warn]   http://teleal.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
[warn]   -- artifact org.teleal.cling#cling-core;1.0.5!cling-core.jar:
[warn]   http://teleal.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.jar
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
[warn]   -- artifact org.teleal.cling#cling-core;1.0.5!cling-core.jar:
[warn]   http://repo1.maven.org/maven2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.jar
[warn] ==== Scala-Tools Maven2 Repository: tried
[warn]   http://scala-tools.org/repo-releases/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
[warn]   -- artifact org.teleal.cling#cling-core;1.0.5!cling-core.jar:
[warn]   http://scala-tools.org/repo-releases/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.jar
[warn]      ::::::::::::::::::::::::::::::::::::::::::::::
[warn]      ::          UNRESOLVED DEPENDENCIES         ::
[warn]      ::::::::::::::::::::::::::::::::::::::::::::::
[warn]      :: org.teleal.cling#cling-core;1.0.5: not found
[warn]      ::::::::::::::::::::::::::::::::::::::::::::::    [error] {file:*************************************************}default-d33f58/*:update: sbt.ResolveException: unresolved dependency: org.teleal.cling#cling-core;1.0.5: not found
[error] Total time: 4 s, completed Feb 19, 2012 1:44:38 PM
更新

差点忘了;我在MacOSX上使用sbt-0.11.0

摘要

存储库teleal.org通过返回响应状态204来响应来自sbt的head请求。响应状态应该与get请求200相同。所以sbt得出结论,这里没有什么可看的

如果teleal.org选择不支持像maven central这样的head请求,那么这一切都会很好;它认为:-)


旁注;sbt使用这个有趣的accept头:“accept:text/html、image/gif、image/jpeg,*;q=.2,/;q=.2'

要查看
更新任务中的调试级别日志,请执行以下操作:

> set logLevel in update := Level.Debug
> update
或者,在运行
update
后,您可以显示调试日志,该日志已保存到磁盘,但未显示:

> last update
您将看到:

[debug]      trying http://teleal.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
[debug]         tried http://teleal.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
[debug] HTTP response status: 204 url=http://teleal.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
[debug]     cling: resource not reachable for org/teleal/cling#cling-core;1.0.5: res=http://teleal.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
该URL的HTTP响应包括HTTP重定向:

Request URL:http://teleal.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
Request Method:GET
Status Code:302 Found

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Host:teleal.org
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11

HTTP/1.1 302 Found
Date: Mon, 20 Feb 2012 10:32:11 GMT
Server: Jetty()
Location: http://4thline.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 1316
Connection: close
Ivy可以跟踪重定向,但是让我们直接使用新的存储库来消除任何疑问。仍然不起作用,我们仍然得到204错误

> set libraryDependencies += "org.teleal.cling" % "cling-core" % "1.0.5"
[info] Reapplying settings...
[info] Set current project to default-759082 (in build file:/Users/jason/code/scratch/20120220/)
> set resolvers += "4thline" at "http://4thline.org/m2" 
> update
...
> last update
...
[debug]      trying http://4thline.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
[debug]         tried http://4thline.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
[debug] HTTP response status: 204 url=http://4thline.org/m2/org/teleal/cling/cling-core/1.0.5/cling-core-1.0.5.pom
该服务器返回一个HTTP204(无内容),但Ivy在2.2.0版之后将返回此消息


一个解决方法是代理该存储库。可以做到这一点,而且设置起来非常简单。

这并不是说可以解决问题,而是sbt的最新版本是0.11.2坦克;见我问题底部的总结。