Block: 450 JVM repos → monorepo
InfoQ’s behind-the-scenes account of Block, Inc. (Cash App + Square) consolidating ~450 JVM repositories from polyrepo into a single monorepo to kill dependency drift. The spoke’s first practitioner source — a real migration at scale, not a tool launch.
The problem: dependency drift
Under polyrepo, independently-versioned shared libraries drifted across services:
- version drift across services, duplicated upgrade effort when a library changed,
- runtime incompatibilities — “classic diamond dependency surprises,”
- and coordinated deployments whenever a change spanned repos. A monorepo resolves shared dependencies from source (not via published, independently-versioned JARs) and allows atomic cross-service changes in one commit — collapsing that coordination overhead.
How they did it — custom tooling, not Bazel
Block built its own infrastructure rather than adopt Bazel:
- a custom IntelliJ plugin that loads only the needed projects and swaps the rest for their published JARs (so the IDE doesn’t choke on the whole tree),
- merge queues to stay stable under high commit volume,
- Gradle convention plugins defining module types (proto / service / library) to enforce architectural boundaries,
- dependency-graph analysis for selective builds scoped to changed files,
- Git performance tuning (exploring sparse checkouts) — the VCS-scaling problem a monorepo forces.
Scale & outcome
8,800 builds/week, p90 CI ~10 min on a stable main; ownership tooling tracks per-project accountability. A senior eng manager framed it as a “step-change in developer experience” (faster builds, cohesive tooling) once the migration landed.
The honest trade-off
Block is explicit that a monorepo is not free: it “requires substantial platform team investment” — “if you can’t commit to properly funding a platform team to support a monorepo, you’ll probably do better with a polyrepo,” and mixed-language/framework estates may not justify it. The win is coordination; the cost is a standing platform-engineering bill.
Tier
T2 — reputable secondary tech journalism (InfoQ) quoting Block’s own engineers; a single-company case study, so the numbers are illustrative, not benchmarks.