Behind the Scenes: Block 450 JVM Repositories Into Monorepo to Reduce Dependency Drift
Summary
Block, Inc. successfully migrated approximately 450 JVM-based repositories from a polyrepo architecture to a monorepo across its Cash App and Square engineering organizations. This large-scale initiative addressed growing coordination and dependency management challenges, including version drift and runtime incompatibilities, inherent in the previous model. The consolidated codebase now supports about 8,800 builds per week, achieving p90 CI times of around 10 minutes on a stable main branch. Key implementation strategies included developing a custom IntelliJ plugin to load only necessary projects, adopting merge queues for high commit volumes, and investing in shared Gradle plugins, dependency graph-based build scoping, and git performance tuning. This transition aimed to simplify cross-service development, enhance dependency visibility, and reduce operational friction.
Key takeaway
For MLOps Engineers or Software Engineers considering a monorepo migration, understand that this architecture demands substantial, ongoing platform team investment. If you cannot commit to properly funding a dedicated platform team, a polyrepo might be a more suitable choice to avoid punishing poorly behaved sibling projects. Ensure your projects are similarly shaped in terms of languages and frameworks to maximize benefits and justify the significant migration effort.
Key insights
Consolidating JVM polyrepos into a monorepo reduces dependency drift and improves developer experience through atomic updates.
Principles
- Monorepos require significant platform team investment.
- Standardized projects benefit most from monorepos.
- Dependency graphs enable efficient build scoping.
Method
Block implemented a custom IntelliJ plugin for project loading, used merge queues, and leveraged shared Gradle plugins with dependency graph-based build scoping and git tuning.
In practice
- Use custom IDE plugins for large monorepos.
- Implement merge queues for high commit volume.
- Define project ownership with tooling.
Topics
- Monorepo Migration
- Dependency Management
- JVM Repositories
- CI/CD Optimization
- Gradle Plugins
- Developer Experience
Code references
Best for: CTO, VP of Engineering/Data, Software Engineer, DevOps Engineer, MLOps Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by InfoQ.