gpt4 book ai didi

scala - 本地依赖由 SBT 解决,但不是由 Play 解决的!框架

转载 作者:行者123 更新时间:2023-12-04 09:18:56 25 4
gpt4 key购买 nike

我正在尝试使用来自 Play 的本地发布的库(使用 SBT 的 publish-local 发布)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

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

最佳答案

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

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

resolvers += Resolver.file("Local repo", file(System.getProperty("user.home") + "/.ivy2/local"))(Resolver.ivyStylePatterns)

关于scala - 本地依赖由 SBT 解决,但不是由 Play 解决的!框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16400877/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com