2012-02-19 65 views
6

存储库http://teleal.org/m2返回的内容是否有问题?这是我的build.sbt文件:即使文件明显存在,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 

更新

差点忘了;我使用的是Mac OS X上SBT-0.11.0

摘要

teleal.org通过返回响应状态204.响应状态回复HEAD请求从SBT存储库本来应该与获取请求200相同。所以sbt得出结论说这里没有什么可以看到的。

如果teleal.org选择不支持Maven中心这样的头部请求,那么这样工作就会很好;它认为:-)

Side-note; sbt使用这个有趣的accept-header:'Accept:text/html,image/gif,image/jpeg,*; q = .2,/; Q = 2.2'

+0

不是说这个修复了这个问题,而是最新版本的sbt是0.11.2 – OlegYch 2012-02-19 18:47:20

回答

5

要看到从update任务日志调试等级:

> 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 

的HTTP响应该URL包括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 

常春藤能进行重定向,但让我们直接使用新的存储库,以消除任何疑虑。仍然不起作用,我们仍然得到了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 

该服务器返回一个HTTP 204(无内容),但常春藤,为2.2.0版本,这is unable to handle

解决方法是代理该存储库。 free version of Sonatype Nexus可以做到这一点,并且非常易于安装。

+1

谢谢;请参阅我的问题底部的摘要。 – thoredge 2012-02-21 22:37:22

相关问题