rules_jvm_external's New Maven-based Resolver

April 26, 2024
bazel tech

The code you’ve written means nothing until it’s in the hands of users.

Normally, the way I like to write features is to put together the smallest thing I can think of, release that, and then incrementally add features and fix bugs. This lowers risk, and makes it far easier to move quickly, but sometimes that’s just not possible.

With the new release of rules_jvm_external 6.1, I finally managed to ship a new Maven-based dependency resolver. I started work on this at the tail end of 2022, with the first proper commit in late January 2023, so it’s been in development a loooong time. I’ve not actually spent that much time hacking on it. It’s taken a long time because it’s something that I’ve hacked in when I have a little time to spare.

The main motivation behind this was to add support for using Maven BOMs in dependency resolutions for Bazel projects, and the initial version included not only a Maven-based resolver, but also a Gradle-based resolver too. There are some lessons I’ve learned along the way, and maybe it would be useful to share some of them.

I realise that these are particularly reflective or considered. I’ve literally just pressed the buttons and thrown the switches for the release, so I’ve not yet sat back and thought about things, but it’s always nice to get some thoughts down while they’re fresh in the mind.

With that said….

A little is better than nothing

It was deeply frustrating to have progress be so slow, but the thing that helped make it bearable was being able to break the problem down into bite-size pieces that I could work on. Being able to see slow progress, rather than nothing at all, was a huge boon.

Small tests #FTW

The way I was able to break things into bite-size pieces was to make use of relatively fine-grained tests. These were hooked up into my test suite and could be run at the drop of a hat, whenever a change was made. Because of careful choices, running the entire test suite takes about 3 seconds, which means I could run it whenever I felt like it. Tightening the feedback loop like this was essential.

Software is collaborative art

Along the way, I got stuck several times, and needed help figuring things out. There were other times when I thought things were done and I could relax. All along the way, there were fellow developers and geeks who were happy to help. Jin and Chris, who are my co-consipirators in the rules_jvm_external repo, have provided endless patient feedback and support. Jon Tirsen helped me find bugs and issues, and even supplied patches (thank you, Jon!)

Now that the software is out, I’m expecting bug reports and feature requests to come rolling in. That’s fine. That’s half the fun, because I know that the people asking for things will be doing so looking to improve things.

Patience is a virtue

Gotta be patient if you’re going to take over a year to ship a feature!

  A New Approach to CI Less recently

A New Approach to CI

September 5, 2023
bazel monorepo tech

There's No Such Thing as a Free Lunch

June 12, 2023
bazel monorepo tech

Your Roots Are Showing

May 10, 2023
bazel tech