Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

The Latest Version of Degraph is Available for Download at Maven Central

DZone's Guide to

The Latest Version of Degraph is Available for Download at Maven Central

· Java Zone
Free Resource

Just released, a free O’Reilly book on Reactive Microsystems: The Evolution of Microservices at Scale. Brought to you in partnership with Lightbend.

Degraph is my personal open source project for visualizing and testing package dependencies in JVM byte code. I released the latest version 0.1.1, so go grab it while it is hot.

What’s new

This release in mainly a bug fixing release. So the important changes are two bug fixes. Degraph 0.1.0 missed a few dependencies to static methods, and through class valued annotations. So you absolutely should upgrade. I hope you don’t use many static methods, so the first bug won’t bite you as bad. The second one is actually quite annoying with certain frameworks. Spring for example uses lot’s of annotations, including those that contain references to classes.

Fortunately upgrading your tests will be easy, because degraph-check is now available through Maven Central, which makes using it really a no-brainer.

Although this release is just a minor one, a tiny new feature slipped in almost by accident. And when I tried it at work it turned out to be extremely helpful: You can now instruct Degraph to create a graphml file for failed tests. Just provide a path using the printTo method. An example looks like this:

test("Check identifies cycles in junit") {
    classpath.printTo("junitDependencyFailure.graphml").including("**.junit.**") should  not be (violationFree)
  }

This allows for a relative quick workflow:

  • Write your test
  • Run the test
  • Open the resulting graphml file in yed
  • Modify code or test
  • Run the test
  • Reopen in yed
  • Repeat the previous three steps until done

I found this tremendously helpful when fixing the problems that the bugfixes mentioned before surfaced.

Give it a try and let me know about your experiences in the comments below, or in the issue tracker over at github.

Strategies and techniques for building scalable and resilient microservices to refactor a monolithic application step-by-step, a free O'Reilly book. Brought to you in partnership with Lightbend.

Topics:

Published at DZone with permission of Jens Schauder, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}