https://github.com/obecker/decycle
Perform package cycle dependency checks in JVM projects (Java, Groovy, Scala, Kotlin, ...)
https://github.com/obecker/decycle
code-quality gradle gradle-plugin java maven-plugin modularization
Last synced: 7 months ago
JSON representation
Perform package cycle dependency checks in JVM projects (Java, Groovy, Scala, Kotlin, ...)
- Host: GitHub
- URL: https://github.com/obecker/decycle
- Owner: obecker
- License: apache-2.0
- Created: 2019-10-04T16:50:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-09-19T07:30:57.000Z (7 months ago)
- Last Synced: 2025-09-19T09:36:26.738Z (7 months ago)
- Topics: code-quality, gradle, gradle-plugin, java, maven-plugin, modularization
- Language: Java
- Homepage:
- Size: 813 KB
- Stars: 13
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](CHANGELOG.md)
[](https://github.com/obecker/decycle/actions/workflows/gradle.yml)
[](https://github.com/obecker/decycle/blob/master/LICENSE)


Decycle detects [circular dependencies](https://en.wikipedia.org/wiki/Circular_dependency) within packages or
[slices](readme/slicings.md) in a Java (or JVM language) project.
Having Decycle as a guard in your project prevents cycles and will help keeping
your code base [clean](https://wiki.sei.cmu.edu/confluence/display/java/DCL60-J.+Avoid+cyclic+dependencies+between+packages)
and [modular](https://www.infoq.com/articles/modular-java-what-is-it/).
Decycle is based on the ideas of [Degraph](http://riy.github.io/degraph/index.html) that was created by
[Jens Schauder](https://github.com/schauder).
Decycle provides the following core features:
* it works with a **minimal configuration** – using just the default settings will find cycles between
the packages of your project
* it provides a **visualization** of the detected package (and slice) dependencies that helps to understand, which
classes are responsible for a certain dependency
* it allows the definition of **custom slicings** and additional dependency constraints
The following example shows a package dependency graph created by Decycle.
It is cycle free (all dependency arcs are on the right side and go downwards).
Hovering over a package will display all incoming and outgoing dependencies.
The width of each arc corresponds to the number of the underlying class dependencies.
Hovering over a dependency arc will show these class dependencies.
Dependencies creating cycles would be displayed as arcs going upwards on the left side of the package blocks.

Decycle requires Java 11 or above.
The recommended way of integrating Decycle is by using the [Gradle](plugin-gradle) or [Maven](plugin-maven) plugins.
## Documentation
There are specific sections in the [Gradle](plugin-gradle/README.md#configuration) and
[Maven](plugin-maven/README.md#configuration) plugin README files for configuring Decycle.
Moreover, there are separate pages about [slicings](readme/slicings.md),
the [pattern syntax](readme/patterns.md) that is used heavily in the configuration,
and the [limitations](readme/limitations.md) of Decycle.
## Subprojects
* [decycle-gradle-plugin](plugin-gradle) is a Gradle plugin that performs Decycle checks of the project sources within
a gradle build.
* [decycle-maven-plugin](plugin-maven) is a Maven plugin that performs Decycle checks of the project sources within
the maven verify phase.
* [decycle-lib](lib) is the core library used by both plugins that might also be used within other JVM projects,
however currently it is not recommended doing so as the API is not stable yet.
## Building
Compile and test the Decycle project
gradlew build
Publish local versions of the current build to maven local
gradlew publishToMavenLocal