1.7 KiB
1.7 KiB
JDK17 + Mockito + CI Stability Implementation Plan
For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
Goal: Stabilize local/CI test execution by fixing Mockito agent startup behavior and pinning CI to JDK 17.
Architecture: Configure Maven Surefire to preload Mockito as a javaagent and set required JVM flags to avoid runtime self-attach failures. Add a CI workflow that always uses JDK 17 and runs compile/test checks. Update README for explicit developer/CI runtime expectations.
Tech Stack: Maven Surefire, Mockito, GitHub Actions, JDK 17, Spring Boot 3.5
Task 1: Build/Test runtime hardening
Files:
- Modify:
pom.xml
- Add explicit
mockito.versionproperty. - Add
maven-surefire-pluginwithargLineincluding:-Djdk.attach.allowAttachSelf=true-XX:+EnableDynamicAgentLoading-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar
Task 2: CI JDK pinning
Files:
- Create:
.github/workflows/ci.yml
- Add workflow on
push+pull_request. - Use
actions/setup-javawith Temurin17. - Run
mvn -q -DskipTests compilethenmvn -q test.
Task 3: Documentation sync
Files:
- Modify:
README.md
- Add explicit local recommended JDK 17 note.
- Add CI note: workflow runs JDK 17 and compile+test.
- Add troubleshooting note for Mockito agent behavior on newer JDKs.
Task 4: Verification
Commands:
mvn -q -DskipTests compilemvn -q test(sandbox)mvn -q test(escalated fallback if sandbox attach restrictions block)- Key checks with
rgfor workflow and surefire config.