Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

JDeps Mvn

The Only Maven Plugin That Understands JDeps

This plugin is all about JDeps and particularly about JDK-internal APIs. With Java 9 (scheduled for 03/2017) such APIs will become unavailable, which may break a project. Redemption comes in four easy steps:

  1. identify your projects' problematic dependencies
  2. create a plan to move away from them
  3. prevent relapses
  4. do the same for your dependencies

This plugin helps with 1️⃣ and 3️⃣, 2️⃣ shouldn't be too hard in most cases but 4️⃣ might be.

How Does It Help?

Running jdeps -jdkinternals against the compiled classes it will discover dependencies on internal APIs. But it not only runs JDeps, it also understands its output, which allows a convenient and detailed configuration of when exactly the build should break. This enables a self-paced migration away from problematic dependencies with immediate failure on relapses.

Since JDeps Mvn actually understands JDeps, it is straight forward to define flexible rules for how dependencies are treated. So you have this package where the use of sun.misc is generally ok except for the one subpackage where everything but Unsafe could already be removed and must not creep back? No problem: -> sun.misc: WARN -> sun.misc: FAIL -> sun.misc.Unsafe: WARN

You find it too tedious to write all these rules by hand? Also no problem. Check out the walkthrough for more on rules, including how to create them automatically.

Quick Start 🚀

To get a first impression how you're doing JDK-internal-wise simply run JDeps Mvn:

mvn clean compile org.codefx.mvn:jdeps-maven-plugin:jdkinternals

This will log every dependency jdeps reports to the console (on level WARN).

Adding the following to your pom yields the same result as above but on every run:

				<!-- define known and acceptable dependencies here (see below) -->

To explicitly run this plugin you can do one of these:

mvn clean compile jdeps:jdkinternals # just this plugin
mvn verify # everything up to the phase in which this plugin runs

Next steps 💢

But we're all too good in ignoring log messages so check out the walkthrough and the rest of the wiki for information on how to advance to the next level.

Contact 👀

Nicolai Parlog


You can’t perform that action at this time.