9 Migration and modularization strategies
This chapter covers
- Preparing a migration to Java 9 and beyond
- Continually integrating changes
- Incrementally modularizing projects
- Generating module declarations with JDeps
- Hacking third-party JARs with the jar tool
- Publishing modular JARs for Java 8 and older
Chapters 6, 7, and 8 discuss the technical details behind migrating to Java 9+ and turning an existing code base into a modular one. This chapter takes a broader view and looks at how to best compose these details into successful migration and modularization efforts. We’ll first discuss how to perform a gradual migration that cooperates well with the development process, particularly build tools and continuous integration. Next, we’ll look at how to use the unnamed module and automatic modules as building blocks for specific modularization strategies. And finally, we’ll cover options for making JARs modular—yours or your dependencies’. When you’re done with this chapter, you’ll not only understand the mechanisms behind migration challenges and modularization features—you’ll also know how to best employ them in your efforts.