Crafting Spring Boot Starters
About the book
Every Spring Boot developer consumes starters. But do you know how to write one of your own?
As your team and your projects grow, so grows the need for shared code. The best way is to provide company-wide starters that all teams can use and depend upon. You can even put such a starter in the open for the whole world to benefit. But how exactly do you ensure that the library is a good Spring Boot citizen? You need to think about defaults, extension points, conditional wiring, testability, observability, documentation and so much more.
Crafting Spring Boot Starters walks you through all these things, showing how to implement them with real starters in the thirty chapters of the book.
The book is for Java developers who have shipped Spring Boot applications and now want to ship libraries.
- Design auto-configuration that activates only when it should, and stays out of the way when it shouldn't.
- Expose SPI interfaces, customizer chains, and configuration properties.
- Test starters in isolation, in slices, and against Testcontainers, including how to write a test starter of your own.
- Instrument library code with Micrometer Observation, custom actuator endpoints, and health indicators.
- Lay out a Maven build that scales from a single module to an autoconfigure + starter + BOM split.
- Publish releases through JReleaser.
- Write a README, samples folder, and reference site that turn a curious reader into an adopter.
The full table of contents of the book can be seen on the Leanpub page.
Super-charge your learning now with Crafting Spring Boot Starters!
The book also includes a zip file with AI skills that can be used with any AI Agent (Claude, Copilot, OpenAI Codex, ChatGPT, Cursor, ...) based on the contents of the book. The AI skills allow you to audit your own Spring Boot starter against the best practices laid out in the book.
What people are saying
PRISMA European Capacity GmbH
Crafting Spring Boot Starters was a breeze to read. Whether you are the cover-to-cover type of reader or prefer to jump straight into a particular chapter for specific advice, this is an excellent guide to best practices for starters and configuration in general.
Every tip is explained thoroughly, motivated by a relatable use case, and discusses not only the preferred solution but also the alternatives and—most importantly—how to choose between them.
You can expect a comprehensive walkthrough, from early design decisions all the way to deployment to Maven Central, with a strong focus on the users of your starter and supporting them with everything Spring Boot has to offer.
The book’s most distinctive quality is its impressive level of detail while remaining compact, to the point, and extremely well structured. As a result, it respects every reader’s time.
Vilnius JUG co-organizer
Crafting Spring Boot Starters takes you on a wonderful journey, introducing you step by step to the things that help you create a maintainable Spring Boot starter. It starts with the basics and then goes deeper into the process.
Two aspects of part I caught my attention. First, a small section telling the reader when using a starter is not a good idea. Having such information encourages you to think twice about whether you are moving in the right direction, before diving into technical details. Second is chapter 3, dedicated to the design principles for library authors — one of my favourite chapters in the whole book. Those concepts are useful in any case, Spring Boot starter or not. Being respectful to the library user, even if it is just yourself, teaches you to follow rules your future self will be grateful for.
Besides the easy-to-read explanation of how to properly do the implementation, the testing, documentation and release/maintenance aspects all have their dedicated place in the book. They elevate the end result to a different level, even if that is not obvious in the beginning. It was nice to see JReleaser being mentioned.
The book can be read from start to finish if you want to learn gradually, or you can check a specific chapter of interest. I would recommend it to any developer who is already familiar with the Spring ecosystem and is planning to work, or already working, on a library or any shared helper or open-source initiative. There are valuable tips in the book even if what you are developing is not a Spring Boot starter.
Writing your own Spring Boot starter is well documented and therefore not that hard. But writing a great Spring Boot starter requires more than is visible at first glance. Crafting Spring Boot Starters therefore, besides the fundamentals, contains lots of valuable and practical advice that you don't find within the reference documentation. And even after having written a few starters, I still picked up new ideas and a few things I hadn't known before.