# The project com.example:my-app:1.0.0 has a cycle in the dependency graph. Cycle: my-app -> module-a -> module-b -> my-app

- **ID:** `java/maven-cyclic-dependency`
- **Domain:** java
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Two or more modules depend on each other directly or transitively, causing a circular dependency.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 8+ | active | — | — |

## Workarounds

1. **Refactor the project to remove the circular dependency by extracting shared classes into a new module** (90% success)
   ```
   Create a new module 'shared' and move common code there, then have both modules depend on 'shared'.
   ```
2. **Use dependency exclusions to break the cycle** (70% success)
   ```
   <dependency><groupId>com.example</groupId><artifactId>module-a</artifactId><exclusions><exclusion><groupId>com.example</groupId><artifactId>my-app</artifactId></exclusion></exclusions></dependency>
   ```

## Dead Ends

- **Removing one dependency entirely without refactoring code** — The code may rely on classes from that dependency, causing compilation errors. (80% fail)
- **Using optional dependencies to break the cycle** — Optional dependencies are still resolved during compilation, so the cycle persists. (90% fail)
