简体   繁体   English

vespa.ai的SBT依赖关系解析失败

[英]SBT Dependency Resolution Failure with vespa.ai

I've added Vespa to an sbt project: 我已经将Vespa添加到sbt项目中:

libraryDependencies += "com.yahoo.vespa" % "vespa-http-client" % "6.225.3"

Which results in the following module resolution failure: 这导致以下模块解析失败:

[warn]  Detected merged artifact: [FAILED     ] com.yahoo.vespa#component;6.225.3!component.container-plugin:  (0ms).
[warn]  Detected merged artifact: [FAILED     ] com.yahoo.vespa#vespajlib;6.225.3!vespajlib.container-plugin:  (0ms).
[warn] ==== local: tried
[warn] ==== local: tried
[warn] ==== public: tried
[warn] ==== public: tried
[warn] ==== local-preloaded-ivy: tried
[warn]   https://repo1.maven.org/maven2/com/yahoo/vespa/component/6.225.3/component-6.225.3.container-plugin
[warn]   C:\Users\gary\.sbt\preloaded\com.yahoo.vespa\vespajlib\6.225.3\container-plugins\vespajlib.container-plugin
[warn] ==== local-preloaded-ivy: tried
[warn] ==== local-preloaded: tried
[warn]   C:\Users\gary\.sbt\preloaded\com.yahoo.vespa\component\6.225.3\container-plugins\component.container-plugin
[warn]   file:/C:/Users/gary/.sbt/preloaded/com/yahoo/vespa/vespajlib/6.225.3/vespajlib-6.225.3.container-plugin
[warn] ==== local-preloaded: tried
[warn]   file:/C:/Users/gary/.sbt/preloaded/com/yahoo/vespa/component/6.225.3/component-6.225.3.container-plugin

Failed with both an older version and latest sbt (1.1.1). 较旧版本和最新sbt(1.1.1)均失败。

SBT uses the artifact's packaging type as file extension by default. 默认情况下,SBT使用工件的打包类型作为文件扩展名。 Our pom.xml for the component artifact (and quite a few others) uses packaging type container-plugin , while the actual jar file of course has the standard jar suffix. 我们用于component工件(以及很多其他component pom.xml使用包装类型container-plugin ,而实际的jar文件当然具有标准的jar后缀。

So you need to configure SBT manually with the file suffix for those artifacts. 因此,您需要使用这些后缀的文件后缀手动配置SBT。 I don't know if there's a convenient way to do this for a set of dependencies at once, as I'm not an SBT expert. 我不知道是否有一种便捷的方法可以立即对一组依赖项执行此操作,因为我不是SBT专家。 But for each individual artifact where you get this error, you could try the following: 但是对于您收到此错误的每个工件,您可以尝试以下操作:

libraryDependencies += "com.yahoo.vespa" % "component" % "6.225.3" artifacts( Artifact("component", "", "jar"))

I found it in this SO answer and haven't tested it myself. 我在这个答案中找到了它,而我自己还没有对其进行测试。 Perhaps you can find some useful information in the SBT reference manual on Using dependencies with artifacts . 也许您可以在SBT参考手册“ 将依赖项与工件一起使用”中找到一些有用的信息。

以下是vespa-http-cient的依赖项: https : //github.com/vespa-engine/vespa/blob/master/vespa-http-client/pom.xml我不太了解SBT,也许您需要明确包含那些依赖关系,或指定包含传递依赖关系。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM