# Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M7:test (default-test) on project my-app: There are test failures. Please refer to /path/to/surefire-reports for the individual test results.

- **ID:** `java/maven-surefire-test-failure`
- **Domain:** java
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

One or more unit tests failed during the test phase, causing the build to fail.

## Version Compatibility

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

## Workarounds

1. **Fix the failing test by analyzing the surefire report and adjusting the test code** (90% success)
   ```
   Check /path/to/surefire-reports/*.txt for stack traces, then fix the test logic.
   ```
2. **Temporarily skip tests using -DskipTests or -Dmaven.test.skip=true** (95% success)
   ```
   mvn install -DskipTests
   ```

## Dead Ends

- **Skipping tests entirely without fixing them** — The tests may catch real bugs, and skipping them can lead to production issues. (60% fail)
- **Deleting the test files to avoid failures** — This removes test coverage and may violate project requirements. (80% fail)
