Integrating with Apache Maven
Two of the build systems that are very commonly used in the Java landscape are Apache Maven and Gradle. When you are working on an enterprise Java application, it's very likely that you'll have to deal with one of these two options. In this book so far, we've been working with the command line to get the compiler and runtime to execute. However, that's rarely a reasonable thing to do in a complex project. So, what does it take to use such a build system in a Java 9 modular application?
Note
At the time of writing this, Maven has a workable integration with Java 9, while Gradle is still in active development. Thus, we'll only be covering Apache Maven integration in this book. It's only a matter of time before the Java tooling ecosystem catches up to the modularity changes in Java 9, so it shouldn't be surprising to see better integration and an overall experience of using these tools with Java 9 over time.
Let's examine the way you can create a Maven project that...