How to find a bazel dependency name for a maven target?

45 Views Asked by At

I'm adding handlebars to a Java project using bazel. The WORKSPACE installs the maven dependency:

...
"com.github.jknack:handlebars.java:4.3.1",
...

Within the BUILD file, how do I determine the dep name? In this case I'm doing:

deps = [
...
"@maven//:com_github_jknack_handlebars_java",
...
]

But this is mostly guess work and following patterns. I've looked over the bazel maven docs and I don't see anything covering how this target is referenced.

1

There are 1 best solutions below

0
Vertexwahn On

I do something like this (query for all maven dependencies and filtering for the dependency I am looking for, e.g. junit):

bazel query "@maven//:*" | grep junit