# scijava-packages-rules
**Repository Path**: mirrors_scijava/scijava-packages-rules
## Basic Information
- **Project Name**: scijava-packages-rules
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-07-22
- **Last Updated**: 2025-10-05
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# no-package-cycles-enforcer-rule
[](https://travis-ci.org/andrena/no-package-cycles-enforcer-rule)
## About
This Maven Enforcer Rule checks your project for package cycles. It fails the build if any package cycle is found, showing you the packages and classes involved in the cycle.
## Usage
Add the following plugin to your POM:
```xml
maven-enforcer-plugin
3.0.0-M2
de.andrena.tools.nopackagecycles
no-package-cycles-enforcer-rule
1.0.9
enforce-no-package-cycles
enforce
test
```
### Including test classes
If you want to exclude tests from cycle checking, you can use the parameter `includeTests` which is set to true by default:
```xml
...
false
...
```
### Restricting scope
**:warning: Only use this, if there is no other way! Once there are exceptions, the connection between those excluded packages
will grow stronger and stronger, without notice!**
If you want to exclude packages or restrict check to certain packages only, you can use `includedPackages` or `excludedPackages` (although you really should not!):
```xml
...
myapp.code.good
...
```
```xml
...
myapp.code.bad
...
```
## See also
* The original version by Daniel Seidewitz on [Stackoverflow](http://stackoverflow.com/questions/3416547/maven-jdepend-fail-build-with-cycles). Improved by showing all packages afflicted with cycles and the corresponding classes importing the conflicting packages.
* [JDepend](https://github.com/clarkware/jdepend), the library being used to detect package cycles.
* For more information about package cycles, see ["The Acyclic Dependencies Principle" by Robert C. Martin (Page 6)](http://www.objectmentor.com/resources/articles/granularity.pdf).
* The [Maven Enforcer Plugin](https://maven.apache.org/enforcer/maven-enforcer-plugin/)