Skip to content

Commit 275a88a

Browse files
committed
Merge branch 'main' into merge-main-20251005
# Conflicts: # AGENTS.md
2 parents fbd79ad + 78758bd commit 275a88a

4 files changed

Lines changed: 47 additions & 41 deletions

File tree

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions:
88
contents: read
99

1010
jobs:
11-
setup:
11+
copilot-setup-steps:
1212
name: Prepare Maven workspace and prime E2E dependencies
1313
runs-on: ubuntu-latest
1414
steps:

.github/workflows/hugo.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ jobs:
5050
- name: Setup Pages
5151
id: pages
5252
uses: actions/configure-pages@v5
53+
with:
54+
enablement: true
5355
- name: Install Node.js dependencies
5456
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
5557
- name: Build with Hugo
@@ -61,7 +63,7 @@ jobs:
6163
--minify \
6264
--baseURL "${{ steps.pages.outputs.base_url }}/"
6365
- name: Upload artifact
64-
uses: actions/upload-pages-artifact@v3
66+
uses: actions/upload-pages-artifact@v4
6567
with:
6668
path: ./site/public
6769

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ e2e/test-results
5555
.aider*
5656
/tools/server/.lwjgl/
5757
/tools/server/.lwjgl/
58+
.m2_repo/

AGENTS.md

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ After each grouped action, post an **Evidence block**, then continue working:
129129
**Evidence template**
130130
```
131131
Evidence:
132-
Command: mvn -o -pl <module> -Dtest=Class#method verify
132+
Command: mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -Dtest=Class#method verify
133133
Report: <module>/target/surefire-reports/<file>.txt
134134
Snippet:
135135
\<copy 10–30 lines capturing the failure or success summary>
@@ -153,7 +153,7 @@ To avoid losing the first test evidence when later runs overwrite `target/*-repo
153153

154154
- Capture and store the last 200 lines of the Maven verify output.
155155
- Example (module‑scoped):
156-
- `mvn -o -pl <module> verify | tee .initial-verify.log`
156+
- `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> verify | tee .initial-verify.log`
157157
- `tail -200 .initial-verify.log > initial-evidence.txt`
158158

159159
• On any failing verify run (unit or IT failures):
@@ -195,6 +195,7 @@ Plan
195195
196196
* **JDK:** 11 (minimum). The project builds and runs on Java 11+.
197197
* **Maven default:** run **offline** using `-o` whenever possible.
198+
* **Maven local repo (required):** always pass `-Dmaven.repo.local=.m2_repo` on all Maven commands (install, verify, plugins, formatting). All examples in this document implicitly assume this flag, even if omitted.
198199
* **Network:** only to fetch missing deps/plugins; then rerun once without `-o`, and return offline.
199200
* **Large project:** some module test suites can take **5–10 minutes**. Prefer **targeted** runs.
200201
@@ -203,14 +204,14 @@ Plan
203204
`-am` is helpful for **compiles**, hazardous for **tests**.
204205
205206
* ✅ Use `-am` **only** for compile/verify with tests skipped (e.g. `-Pquick`):
206-
* `mvn -o -pl <module> -am -Pquick install`
207+
* `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -am -Pquick install`
207208
* ❌ Do **not** use `-am` with `verify` when tests are enabled.
208209
209210
**Two-step pattern (fast + safe)**
210211
1. **Compile deps fast (skip tests):**
211-
`mvn -o -pl <module> -am -Pquick install`
212+
`mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -am -Pquick install`
212213
2. **Run tests:**
213-
`mvn -o -pl <module> verify | tail -500`
214+
`mvn -o -Dmaven.repo.local=.m2_repo -pl <module> verify | tail -500`
214215
215216
It is illegal to `-am` when running tests!
216217
It is illegal to `-q` when running tests!
@@ -219,22 +220,22 @@ It is illegal to `-q` when running tests!
219220
220221
## Always Install Before Tests (Required)
221222
222-
The Maven reactor resolves inter-module dependencies from the local Maven repository (`~/.m2/repository`).
223+
The Maven reactor resolves inter-module dependencies from the configured local Maven repository (here: `.m2_repo`).
223224
Running `install` publishes your changed modules there so downstream modules and tests pick up the correct versions.
224225
225-
* Always run `mvn -o -Pquick install | tail -200` before you start working. This command typically takes up to 30 seconds. Never use a small timeout than 30,000 ms.
226-
* Always run `mvn -o -Pquick install | tail -200` before any `verify` or test runs.
226+
* Always run `mvn -o -Dmaven.repo.local=.m2_repo -Pquick install | tail -200` before you start working. This command typically takes up to 30 seconds. Never use a small timeout than 30,000 ms.
227+
* Always run `mvn -o -Dmaven.repo.local=.m2_repo -Pquick install | tail -200` before any `verify` or test runs.
227228
* If offline resolution fails due to a missing dependency or plugin, rerun the exact `install` command once without `-o`, then return offline.
228229
* Skipping this step can lead to stale or missing artifacts during tests, producing confusing compilation or linkage errors.
229-
* Never ever change the repo location. Never use `-Dmaven.repo.local=.m2_repo`.
230+
* Always use a workspace-local Maven repository: append `-Dmaven.repo.local=.m2_repo` to all Maven commands (install, verify, formatter, etc.).
230231
* Always try to run these commands first to see if they run without needing any approvals from the user w.r.t. the sandboxing.
231232
232233
Why this is mandatory
233234
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`.
235+
- 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 configured local repository (here: `.m2_repo`).
236+
- Therefore, tests only see whatever versions were last published to the configured local repo (`.m2_repo`). 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_repo` first.
237+
- The reliable way to ensure all tests always use the latest code across the entire multi‑module build is to install all modules to the configured local repo (`.m2_repo`) before running any tests: run `mvn -o -Dmaven.repo.local=.m2_repo -Pquick install` at the repository root.
238+
- 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 -Dmaven.repo.local=.m2_repo -Pquick install` so the latest jars are available to the reactor from `.m2_repo`.
238239
---
239240
240241
## Quick Start (First 10 Minutes)
@@ -243,13 +244,13 @@ Why this is mandatory
243244
* Inspect root `pom.xml` and module tree (see “Maven Module Overview”).
244245
* Search fast with ripgrep: `rg -n "<symbol or string>"`
245246
2. **Build sanity (fast, skip tests)**
246-
* `mvn -o -Pquick install | tail -200`
247+
* `mvn -o -Dmaven.repo.local=.m2_repo -Pquick install | tail -200`
247248
3. **Format (Java, imports, XML)**
248-
* `mvn -o -q -T 2C formatter:format impsort:sort xml-format:xml-format`
249+
* `mvn -o -Dmaven.repo.local=.m2_repo -q -T 2C formatter:format impsort:sort xml-format:xml-format`
249250
4. **Targeted tests (tight loops)**
250-
* Module: `mvn -o -pl <module> verify | tail -500`
251-
* Class: `mvn -o -pl <module> -Dtest=ClassName verify | tail -500`
252-
* Method: `mvn -o -pl <module> -Dtest=ClassName#method verify | tail -500`
251+
* Module: `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> verify | tail -500`
252+
* Class: `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -Dtest=ClassName verify | tail -500`
253+
* Method: `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -Dtest=ClassName#method verify | tail -500`
253254
5. **Inspect failures**
254255
* **Unit (Surefire):** `<module>/target/surefire-reports/`
255256
* **IT (Failsafe):** `<module>/target/failsafe-reports/`
@@ -343,8 +344,8 @@ It is illegal to `-q` when running tests!
343344
344345
* **Plan:** small, verifiable steps; keep one `in_progress`.
345346
* **Change:** minimal, surgical edits; keep style/structure consistent.
346-
* **Format:** `mvn -o -q -T 2C formatter:format impsort:sort xml-format:xml-format`
347-
* **Compile (fast):** `mvn -o -pl <module> -am -Pquick install | tail -500`
347+
* **Format:** `mvn -o -Dmaven.repo.local=.m2_repo -q -T 2C formatter:format impsort:sort xml-format:xml-format`
348+
* **Compile (fast):** `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -am -Pquick install | tail -500`
348349
* **Test:** start smallest (class/method → module). For integration, run module `verify`.
349350
* **Triage:** read reports; fix root cause; expand scope only when needed.
350351
* **Iterate:** keep momentum; escalate only when blocked or irreversible.
@@ -371,7 +372,7 @@ It is illegal to `-q` when running tests!
371372
372373
### Optional: Redirect test stdout/stderr to files
373374
```bash
374-
mvn -o -pl <module> -Dtest=ClassName[#method] -Dmaven.test.redirectTestOutputToFile=true verify | tail -500
375+
mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -Dtest=ClassName[#method] -Dmaven.test.redirectTestOutputToFile=true verify | tail -500
375376
````
376377
377378
Logs under:
@@ -415,14 +416,16 @@ Assertions are executable claims about what must be true. Use **temporary tripwi
415416
416417
* Always run before finalizing:
417418
418-
* `mvn -o -q -T 2C formatter:format impsort:sort xml-format:xml-format`
419+
* `mvn -o -Dmaven.repo.local=.m2_repo -q -T 2C formatter:format impsort:sort xml-format:xml-format`
419420
* Style: no wildcard imports; 120‑char width; curly braces always; LF endings.
420421
421422
---
422423
423424
## Source File Headers
424425
425-
Use this exact header for **new Java files only** (replace `${year}` with current year):
426+
Strict requirement — copy/paste exactly. All new Java source files MUST begin with the exact header below. The text, spacing, punctuation, URL, and SPDX line must be identical. Replace `${year}` with the correct current year at the time the file is created.
427+
428+
Hint: get the current year with `date +%Y`.
426429
427430
```
428431
/*******************************************************************************
@@ -443,9 +446,9 @@ Do **not** modify existing headers’ years.
443446
444447
## Pre‑Commit Checklist
445448
446-
* **Format:** `mvn -o -q -T 2C formatter:format impsort:sort xml-format:xml-format`
447-
* **Compile (fast path):** `mvn -o -Pquick install | tail -200`
448-
* **Tests (targeted):** `mvn -o -pl <module> verify | tail -500` (broaden as needed)
449+
* **Format:** `mvn -o -Dmaven.repo.local=.m2_repo -q -T 2C formatter:format impsort:sort xml-format:xml-format`
450+
* **Compile (fast path):** `mvn -o -Dmaven.repo.local=.m2_repo -Pquick install | tail -200`
451+
* **Tests (targeted):** `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> verify | tail -500` (broaden as needed)
449452
* **Reports:** zero new failures in Surefire/Failsafe, or explain precisely.
450453
* **Evidence:** Routine A — failing pre‑fix + passing post‑fix.
451454
Routine B — **pre/post green** from same selection + **Hit Proof**.
@@ -515,19 +518,19 @@ Do **not** modify existing headers’ years.
515518
516519
## Running Tests
517520
518-
* By module: `mvn -o -pl core/sail/shacl verify | tail -500`
519-
* Entire repo: `mvn -o verify` (long; only when appropriate)
521+
* By module: `mvn -o -Dmaven.repo.local=.m2_repo -pl core/sail/shacl verify | tail -500`
522+
* Entire repo: `mvn -o -Dmaven.repo.local=.m2_repo verify` (long; only when appropriate)
520523
* Slow tests (entire repo):
521-
`mvn -o verify -PslowTestsOnly,-skipSlowTests | tail -500`
524+
`mvn -o -Dmaven.repo.local=.m2_repo verify -PslowTestsOnly,-skipSlowTests | tail -500`
522525
* Slow tests (by module):
523-
`mvn -o -pl <module> verify -PslowTestsOnly,-skipSlowTests | tail -500`
526+
`mvn -o -Dmaven.repo.local=.m2_repo -pl <module> verify -PslowTestsOnly,-skipSlowTests | tail -500`
524527
* Slow tests (specific test):
525528
526-
* `mvn -o -pl core/sail/shacl -PslowTestsOnly,-skipSlowTests -Dtest=ClassName#method verify | tail -500`
529+
* `mvn -o -Dmaven.repo.local=.m2_repo -pl core/sail/shacl -PslowTestsOnly,-skipSlowTests -Dtest=ClassName#method verify | tail -500`
527530
* Integration tests (entire repo):
528-
`mvn -o verify -PskipUnitTests | tail -500`
531+
`mvn -o -Dmaven.repo.local=.m2_repo verify -PskipUnitTests | tail -500`
529532
* Integration tests (by module):
530-
`mvn -o -pl <module> verify -PskipUnitTests | tail -500`
533+
`mvn -o -Dmaven.repo.local=.m2_repo -pl <module> verify -PskipUnitTests | tail -500`
531534
* Useful flags:
532535
533536
* `-Dtest=ClassName`
@@ -540,10 +543,10 @@ Do **not** modify existing headers’ years.
540543
## Build
541544
542545
* **Build without tests (fast path):**
543-
`mvn -o -Pquick install`
546+
`mvn -o -Dmaven.repo.local=.m2_repo -Pquick install`
544547
* **Verify with tests:**
545-
Targeted module(s): `mvn -o -pl <module> verify`
546-
Entire repo: `mvn -o verify` (use judiciously)
548+
Targeted module(s): `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> verify`
549+
Entire repo: `mvn -o -Dmaven.repo.local=.m2_repo verify` (use judiciously)
547550
* **When offline fails due to missing deps:**
548551
Re‑run the **exact** command **without** `-o` once to fetch, then return to `-o`.
549552
@@ -554,9 +557,9 @@ Do **not** modify existing headers’ years.
554557
JaCoCo is configured via the `jacoco` Maven profile in the root POM. Surefire/Failsafe honor the prepared agent `argLine`, so no extra flags are required beyond `-Pjacoco`.
555558
556559
- Run with coverage
557-
- Module: `mvn -o -pl <module> -Pjacoco verify | tail -500`
558-
- Class: `mvn -o -pl <module> -Pjacoco -Dtest=ClassName verify | tail -500`
559-
- Method: `mvn -o -pl <module> -Pjacoco -Dtest=ClassName#method verify | tail -500`
560+
- Module: `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -Pjacoco verify | tail -500`
561+
- Class: `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -Pjacoco -Dtest=ClassName verify | tail -500`
562+
- Method: `mvn -o -Dmaven.repo.local=.m2_repo -pl <module> -Pjacoco -Dtest=ClassName#method verify | tail -500`
560563
561564
- Where to find reports (per module)
562565
- Exec data: `<module>/target/jacoco.exec`

0 commit comments

Comments
 (0)