我正在尝试使用banana-RDF,一个本地发布的库(使用SBT的本地发布)来自Play!框架项目,但是当从Play的控制台运行编译时,想要的库没有被解析,当从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
任何人都可以解释这里发生的事情吗?先感谢您.
问题是SBT的publish-local将你的库发布到〜/ .ivy2 / local,而Play似乎有他的ivy2本地存储库指针指向他自己的安装文件夹的ivy2存储库(你的/home_local/.installedSoftware/play-2.1. 1 /存储库/本地).
您可以将此解析器添加到Play的Build.scala中:
resolvers += Resolver.file("Local repo", file(System.getProperty("user.home") + "/.ivy2/local"))(Resolver.ivyStylePatterns)
翻译自:https://stackoverflow.com/questions/16400877/local-dependencies-resolved-by-sbt-but-not-by-play-framework