1---2name: junit5-ci3description: Use when Codex needs to run JUnit 5 tests through Maven, Gradle, or the Console Launcher, configure CI pipelines, manage tags and reports, or debug environment-specific execution issues.4---56# JUnit 5 CI78## 1. Inspect the Execution Path9101. Identify whether the repo uses Maven, Gradle, the Console Launcher, or mixed execution paths.112. Confirm how tests are filtered, tagged, and reported.123. Read [references/build-and-run.md](references/build-and-run.md) before changing pipeline behavior.134. Read [references/tool-recipes.md](references/tool-recipes.md) when the repo supports more than one execution path.1415## 2. Configure Safely16171. Use `useJUnitPlatform()` in Gradle-based execution.182. Use current Surefire or Failsafe configuration already established by the repo when possible.193. Keep tags, includes, excludes, and reporting explicit.204. Use `junit-platform.properties` for shared execution parameters when the repo already follows that pattern.215. Keep local and CI commands aligned unless the repo intentionally separates them.2223## 3. Debug CI Failures24251. Compare local and CI Java versions.262. Compare environment variables, locale, time zone, and file-system assumptions.273. Compare build commands and active profiles.284. Read [references/ci-failure-patterns.md](references/ci-failure-patterns.md) when failures reproduce only in automation.295. Read [references/tagging-and-reporting.md](references/tagging-and-reporting.md) before changing tag filters or report outputs.3031## 4. Examples32331. Input: `Make these JUnit 5 integration tests run in Maven CI only.`34 Output: Configure naming, tags, or Failsafe boundaries without breaking fast local feedback.352. Input: `Gradle discovers no tests.`36 Output: Verify `useJUnitPlatform()`, naming conventions, and source-set wiring.373. Input: `Split fast unit tests from slower integration coverage in Maven.`38 Output: Use tags, naming, or Surefire/Failsafe boundaries that fit the existing build model.3940## 5. Troubleshooting41421. Problem: No tests are discovered.43 Fix: Check task configuration, naming conventions, and JUnit Platform enablement.442. Problem: CI fails but local passes.45 Fix: Compare Java version, environment, and execution flags before changing test logic.463. Problem: Reports exist locally but not in CI artifacts.47 Fix: Check report output paths, pipeline artifact collection, and the actual test task that runs in automation.