Multi-Project Builds With Gradle and Fat JARs With Shadow
When deciding on your dependency manager in Java, you have two main choices: Maven and Gradle (or something more complex like Google’s Bazel). Both manage dependencies well, have robust plugin systems, support checkstyles, run tests, and build/publish JARs and sources. Pick whatever you are comfortable with. Gradle is a little less verbose and is what we will be using.
Multi-project builds are very useful for splitting a project into separate dependencies. For example, you may have a REST service that is split into three projects core for common models/logic, client for the HTTP client that interacts with the server, and the server. You wouldn’t want database dependencies in the client library, so this is a clean separation of concerns. We will be using the StubbornJava projects in the example, but the separation of logic still holds.
via DZone.com Feed https://dzone.com
May 17, 2017 at 11:39AM