Commit de5827e
fix(spring): Resolve archetype working dir from user.dir when PWD is unusable
The post-generate script took the shell working directory from the PWD
environment variable to resolve a relative -DprojectDirectory. Under Git Bash on
Windows, PWD is a Unix-style path (e.g. /c/Users/...) that java.io.File
mis-resolves to a bogus drive-relative path, so the generated tests were copied
outside the project and a stray demo project (its pom.xml included) could be left
behind. Trust PWD only when it names an existing directory on this platform;
otherwise fall back to user.dir, the real JVM working directory.
Also correct the README and archetype docs to use a cross-platform relative
scratch directory (target/audit-scratch) instead of a Unix /tmp path that is
mis-resolved on Windows.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UkRk16pW4VEM3E6vrDoG5y1 parent 3929562 commit de5827e
3 files changed
Lines changed: 11 additions & 9 deletions
File tree
- archetype/src/main/resources/META-INF
- integration/src/site/asciidoc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
0 commit comments