Using jdeps to find dependencies in a Java application
The first step in modularizing your application is to identify its dependencies. A static analysis tool called jdeps
was introduced in JDK 8 to enable developers to find the dependencies of their applications. There are multiple options supported in the command, which enables developers to check for dependencies in the JDK internal APIs, show the dependencies at the package level, show the dependencies at the class level, and filter the dependencies, among other options.
In this recipe, we will look at how to make use of the jdeps
tool by exploring its functionality and using the multiple command-line options it supports.
Getting ready
We need a sample application that we can run against the jdeps
command to find its dependencies. So, we thought of creating a very simple application that uses the Jackson API to consume JSON from the REST API: http://jsonplaceholder.typicode.com/users.
In the sample code, we also added a call to the deprecated...