bazelbuild / migration-tooling

Migration tools for Bazel
Apache License 2.0
45 stars 30 forks source link

Consider implementing migration_tools as a Maven plugin #89

Open jirkadanek opened 6 years ago

jirkadanek commented 6 years ago

I had a bad experience with the migration-tools. First, it was unable to handle declarations such as

<relativePath>../parent</relativePath>

(It expected a file, when directory was provided, it did not default to pom.xml in the directory, which is maven's behavior).

Next, the generation of workspace took a very long time, and it was redownloading the same artifacts multiple times from the remote repository. (I have a maven reactor build, with large number of modules.)

Finally, the generate_workspace.bzl contained dependencies on artifacts from inside the generated project. The way to get rid of that was to set a repository which does not have snapshot builds of my project. That would cause to skip these.

Given all that, I believe a good way to avoid most of the above is to offload the burden to Maven itself, and write a Maven plugin to perform this task.

The core of this functionality is essentially a rip-off of the dependency:tree plugin. I experimented with that and what I have is a yet another 80% solution, but I believe the Maven plugin idea has much to recommend.