2

I've added Vespa to an sbt project:

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).

garysieling
  • 346
  • 2
  • 7

2 Answers2

2

SBT uses the artifact's packaging type as file extension by default. 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.

So you need to configure SBT manually with the file suffix for those artifacts. 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. 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.

gjoranv
  • 4,376
  • 3
  • 21
  • 37
1

Here are the dependencies of vespa-http-cient: https://github.com/vespa-engine/vespa/blob/master/vespa-http-client/pom.xml I don't know SBT very well, maybe you need to explicitly include those dependencies, or specify to include transitive dependencies.

Jon
  • 2,043
  • 11
  • 9