Skip to content

Commit 5c281fa

Browse files
committed
update AGENTS.md
1 parent 16e49c2 commit 5c281fa

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,13 @@ Running `install` publishes your changed modules there so downstream modules and
228228
* Skipping this step can lead to stale or missing artifacts during tests, producing confusing compilation or linkage errors.
229229
* Never ever change the repo location. Never use `-Dmaven.repo.local=.m2_repo`.
230230
* Always try to run these commands first to see if they run without needing any approvals from the user w.r.t. the sandboxing.
231+
232+
Why this is mandatory
233+
234+
- Tests must not use `-am`. Without `-am`, Maven will not build upstream modules when you run tests; it will resolve cross‑module dependencies from the local `~/.m2/repository` instead.
235+
- Therefore, tests only see whatever versions were last published to `~/.m2`. If you change code in one module and then run tests in another, those tests will not see your changes unless the updated module has been installed to `~/.m2` first.
236+
- The reliable way to ensure all tests always use the latest code across the entire multi‑module build is to install all modules to `~/.m2` before running any tests: run `mvn -o -Pquick install` at the repository root.
237+
- In tight loops you may also install a specific module and its deps (`-pl <module> -am -Pquick install`) to iterate quickly, but before executing tests anywhere that depend on your changes, run a root‑level `mvn -o -Pquick install` so the latest jars are available to the reactor from `~/.m2`.
231238
---
232239
233240
## Quick Start (First 10 Minutes)

0 commit comments

Comments
 (0)