bazel-deps
bazel-deps copied to clipboard
Take Maven coords instead of YAML
... well, maybe not instead, both support something like
dependencies:
'javax.servlet:javax.servlet-api:jar:4.0.0'
Instead of
dependencies:
javax.servlet:
javax.servlet-api:
version: "4.0.0"
lang: java
supporting both might be nice, but honestly, our main use case is scala, so how would you do the scala? The issue in scala is that the scala version needs to be appended onto the end of the artifact id.
We can figure something out.
Wouldn't your example be: javax.servlet:javax.servlet-api:4.0.0
do we need the :jar
there?
I was copy-pasting a bunch of coords from https://mvnrepository.com/, where you can request the UI to print the coords in various ways.
For projects with dozens of dependencies this might be an extra hurdle.
I don't know much about maven coords, I admit.
I'd expect the :jar
to be added by default by Maven itself.
jar is an optional packaging type. For others it's mandatory. There's also classifier and I think something else.
Looked at this again, indeed I was missing a :jar
somewhere in there.
My plan is to leverage mvn dependency:tree
to print all dependencies in a pom.xml
file and any submodules, and then more or less copy-paste the result into the YAML file that bazel-deps consumes.
@johnynek do you have a preference of how this looks like? do I allow strings instead of MavenGroup
objects? or should I create a separate section (dependencies-coords
?) in the YAML file?
Also, if you can give me code pointers of how to do this it'll save me a lot of time fighting with Scala :)
have you looked at this:
https://github.com/johnynek/bazel-deps/blob/master/src/scala/com/github/johnynek/bazel_deps/maven/Tool.scala#L326
which can generate WORKSPACES and BUILDs from poms?
it would be nice to document that more and maybe unify it with the main tool, but it seemed separate enough.