Is there a migration path from Maven to Bazel?

与世无争的帅哥 提交于 2019-12-22 02:32:08

问题


Now that Bazel (http://bazel.io/) has been opensourced, is there an incremental process by which I can gradually migrate (a large repository) from Maven to Bazel?


回答1:


In the two years since Ulf responded, there's been a few efforts to assist with maven to bazel migration. In particular, the Bazel team is creating a tool to assist with this: https://github.com/bazelbuild/migration-tooling

The tool generates expansive WORKSPACE files from a set of pom files or maven coordinates. In the ideal case, you can pass the path to your maven project, and then it will generate a bzl file you can load into the WORKSPACE file.

More commentary on how to manage external dependencies can be found here: https://bazel.build/versions/master/docs/external.html




回答2:


I work on Bazel. No, as far as we know there is no such process. I wish.

We have been running some migrations from other build systems to Bazel; the evidence isn't conclusive, but it's difficult to even envision how an incremental process would look like. There are some scenarios where we can envision one build system generating configuration files for another (like gyp), but then you still need to switch wholesale.




回答3:


And another update (2018)...

There is a dedicated guide on migrating from Maven build tool to Bazel.

And on a general note, it’s best to have both build tools running in parallel until you have fully migrated your development team, CI system, and any other relevant integrations. You can run Maven and Bazel in the same repository.

https://docs.bazel.build/versions/master/migrate-maven.html




回答4:


September 2019 update

Wix published a tool called Exodus to automatically migrate your Maven project to Bazel.

Additionally, rules_jvm_external has support for managing transitive Maven artifact dependencies.

May 2018 update

Here's another update using Jadep, a BUILD file generator for your Java projects.

There's a tutorial by the author who migrated google-java-format to Bazel: https://github.com/cgrushko/text/blob/master/migrating-gjf-to-bazel.md



来源:https://stackoverflow.com/questions/29342063/is-there-a-migration-path-from-maven-to-bazel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!