You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
4
8
5
9
Usage: Add the following plugin to your POM:
@@ -32,6 +36,8 @@ Usage: Add the following plugin to your POM:
32
36
</plugin>
33
37
```
34
38
39
+
### Include test classes
40
+
35
41
If you want to exclude tests from cycle checking, you can use the parameter `includeTests` which is set to true by default:
36
42
```xml
37
43
...
@@ -43,6 +49,8 @@ If you want to exclude tests from cycle checking, you can use the parameter `inc
43
49
...
44
50
```
45
51
52
+
### Restrict scope
53
+
46
54
If you want to exclude packages or restrict check to certain packages only, you can use `includedPackages` or `excludedPackages`:
47
55
**:warning: only use this, if there is no other way! Once there are exceptions, the connection between those excluded packages
48
56
will grow stronger and stronger, without notice!**
@@ -70,8 +78,8 @@ will grow stronger and stronger, without notice!**
70
78
...
71
79
```
72
80
81
+
## See also
73
82
74
-
See also:
75
83
* 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.
76
84
*[JDepend](https://github.com/clarkware/jdepend), the library being used to detect package cycles.
77
85
* 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).
0 commit comments