7

我正在尝试使用publish-local来自 Play! 的本地发布的库(使用 SBT 发布)banana-RDF!框架项目,但是compile从 Play 的控制台运行时,所需的库没有得到解决,compile从 SBT 的控制台使用时一切正常。

我发现这种行为很奇怪,因为 Play 使用 SBT 来解决依赖关系。顺便说一句,我在我的 Play 项目中使用的是 0.12.3 版本的 SBT。

使用 Play 编译时遇到的错误非常基本:

[warn]  module not found: org.w3#banana_2.10;2013_02_21-SNAPSHOT            
[warn] ==== local: tried
[warn]   /home_local/.installedSoftware/play-2.1.1/repository/local/org.w3/banana_2.10/2013_02_21-SNAPSHOT/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/w3/banana_2.10/2013_02_21-SNAPSHOT/banana_2.10-2013_02_21-SNAPSHOT.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn]   http://repo.typesafe.com/typesafe/snapshots/org/w3/banana_2.10/2013_02_21-SNAPSHOT/banana_2.10-2013_02_21-SNAPSHOT.pom
[warn] ==== Akka Snapshots: tried
[warn]   http://repo.akka.io/snapshots/org/w3/banana_2.10/2013_02_21-SNAPSHOT/banana_2.10-2013_02_21-SNAPSHOT.pom
[warn] ==== OSS117: tried
[warn]   http://oss.sonatype.org/content/repositories/snapshots/org/w3/banana_2.10/2013_02_21-SNAPSHOT/banana_2.10-2013_02_21-SNAPSHOT.pom
[warn] ==== Local Maven Repository: tried
[warn]   file:///home_local/.m2/repository/org/w3/banana_2.10/2013_02_21-SNAPSHOT/banana_2.10-2013_02_21-SNAPSHOT.pom
[warn] ==== Local SBT Repository: tried
[warn]   file:///home_local/.ivy2/local/org/w3/banana_2.10/2013_02_21-SNAPSHOT/banana_2.10-2013_02_21-SNAPSHOT.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/w3/banana_2.10/2013_02_21-SNAPSHOT/banana_2.10-2013_02_21-SNAPSHOT.pom

谁能解释这里发生了什么?先感谢您。

4

1 回答 1

23

问题是 SBT 将publish-local您的库发布到~/.ivy2/local,而 Play 似乎将他的 ivy2 本地存储库指针指向他自己的安装文件夹(您的/home_local/.installedSoftware/play-2.1.1/repository/local)的 ivy2 存储库。

例如,您可以将此解析器添加到您的 Play 中Build.scala

resolvers += Resolver.file("Local repo", file(System.getProperty("user.home") + "/.ivy2/local"))(Resolver.ivyStylePatterns)
于 2013-05-07T19:18:05.227 回答