aw-spec-cli 0.1.22 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,784 @@
1
+ # AW-SPEC FOUNDATION PACK
2
+ # foundation: Hexagonal
3
+ # sentinel: io.appweaver
4
+ # generated: 2026-09-10T06:05:06.0000000Z
5
+ # files: 9
6
+ # directories: 32
7
+ # format: aw-spec-pack/v1
8
+ # --- Java foundation replacement contract ---
9
+ # Java content: io.appweaver -> <lowercase-app-name>
10
+ # Java path: io/appweaver -> <lowercase-app-name>
11
+ # Application directory preserves the user-provided name.
12
+ # ============================================================
13
+
14
+ <<<DIR path=".mvn">>>
15
+ <<<ENDDIR>>>
16
+ <<<DIR path=".mvn/wrapper">>>
17
+ <<<ENDDIR>>>
18
+ <<<DIR path="src">>>
19
+ <<<ENDDIR>>>
20
+ <<<DIR path="src/main">>>
21
+ <<<ENDDIR>>>
22
+ <<<DIR path="src/main/java">>>
23
+ <<<ENDDIR>>>
24
+ <<<DIR path="src/main/java/io">>>
25
+ <<<ENDDIR>>>
26
+ <<<DIR path="src/main/java/io/appweaver">>>
27
+ <<<ENDDIR>>>
28
+ <<<DIR path="src/main/java/io/appweaver/adapter">>>
29
+ <<<ENDDIR>>>
30
+ <<<DIR path="src/main/java/io/appweaver/adapter/in">>>
31
+ <<<ENDDIR>>>
32
+ <<<DIR path="src/main/java/io/appweaver/adapter/in/controller">>>
33
+ <<<ENDDIR>>>
34
+ <<<DIR path="src/main/java/io/appweaver/application">>>
35
+ <<<ENDDIR>>>
36
+ <<<DIR path="src/main/java/io/appweaver/application/dto">>>
37
+ <<<ENDDIR>>>
38
+ <<<DIR path="src/main/java/io/appweaver/application/dto/request">>>
39
+ <<<ENDDIR>>>
40
+ <<<DIR path="src/main/java/io/appweaver/application/dto/response">>>
41
+ <<<ENDDIR>>>
42
+ <<<DIR path="src/main/java/io/appweaver/application/port">>>
43
+ <<<ENDDIR>>>
44
+ <<<DIR path="src/main/java/io/appweaver/application/port/in">>>
45
+ <<<ENDDIR>>>
46
+ <<<DIR path="src/main/java/io/appweaver/application/port/out">>>
47
+ <<<ENDDIR>>>
48
+ <<<DIR path="src/main/java/io/appweaver/application/service">>>
49
+ <<<ENDDIR>>>
50
+ <<<DIR path="src/main/java/io/appweaver/domain">>>
51
+ <<<ENDDIR>>>
52
+ <<<DIR path="src/main/java/io/appweaver/domain/entity">>>
53
+ <<<ENDDIR>>>
54
+ <<<DIR path="src/main/java/io/appweaver/domain/enums">>>
55
+ <<<ENDDIR>>>
56
+ <<<DIR path="src/main/java/io/appweaver/domain/exception">>>
57
+ <<<ENDDIR>>>
58
+ <<<DIR path="src/main/java/io/appweaver/domain/valueObjects">>>
59
+ <<<ENDDIR>>>
60
+ <<<DIR path="src/main/java/io/appweaver/infrastructure">>>
61
+ <<<ENDDIR>>>
62
+ <<<DIR path="src/main/java/io/appweaver/infrastructure/config">>>
63
+ <<<ENDDIR>>>
64
+ <<<DIR path="src/main/java/io/appweaver/infrastructure/persistence">>>
65
+ <<<ENDDIR>>>
66
+ <<<DIR path="src/main/java/io/appweaver/infrastructure/persistence/mapper">>>
67
+ <<<ENDDIR>>>
68
+ <<<DIR path="src/main/resources">>>
69
+ <<<ENDDIR>>>
70
+ <<<DIR path="src/test">>>
71
+ <<<ENDDIR>>>
72
+ <<<DIR path="src/test/java">>>
73
+ <<<ENDDIR>>>
74
+ <<<DIR path="src/test/java/io">>>
75
+ <<<ENDDIR>>>
76
+ <<<DIR path="src/test/java/io/appweaver">>>
77
+ <<<ENDDIR>>>
78
+ <<<FILE path=".gitattributes">>>
79
+ /mvnw text eol=lf
80
+ *.cmd text eol=crlf
81
+ <<<ENDFILE>>>
82
+ <<<FILE path=".gitignore">>>
83
+ HELP.md
84
+ target/
85
+ .mvn/wrapper/maven-wrapper.jar
86
+ !**/src/main/**/target/
87
+ !**/src/test/**/target/
88
+
89
+ ### STS ###
90
+ .apt_generated
91
+ .classpath
92
+ .factorypath
93
+ .project
94
+ .settings
95
+ .springBeans
96
+ .sts4-cache
97
+
98
+ ### IntelliJ IDEA ###
99
+ .idea
100
+ *.iws
101
+ *.iml
102
+ *.ipr
103
+
104
+ ### NetBeans ###
105
+ /nbproject/private/
106
+ /nbbuild/
107
+ /dist/
108
+ /nbdist/
109
+ /.nb-gradle/
110
+ build/
111
+ !**/src/main/**/build/
112
+ !**/src/test/**/build/
113
+
114
+ ### VS Code ###
115
+ .vscode/
116
+ foundation/appweaver.hexagonal/data/
117
+ *.mv.db
118
+ <<<ENDFILE>>>
119
+ <<<FILE path=".mvn/wrapper/maven-wrapper.properties">>>
120
+ wrapperVersion=3.3.4
121
+ distributionType=only-script
122
+ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
123
+ <<<ENDFILE>>>
124
+ <<<FILE path="mvnw">>>
125
+ #!/bin/sh
126
+ # ----------------------------------------------------------------------------
127
+ # Licensed to the Apache Software Foundation (ASF) under one
128
+ # or more contributor license agreements. See the NOTICE file
129
+ # distributed with this work for additional information
130
+ # regarding copyright ownership. The ASF licenses this file
131
+ # to you under the Apache License, Version 2.0 (the
132
+ # "License"); you may not use this file except in compliance
133
+ # with the License. You may obtain a copy of the License at
134
+ #
135
+ # http://www.apache.org/licenses/LICENSE-2.0
136
+ #
137
+ # Unless required by applicable law or agreed to in writing,
138
+ # software distributed under the License is distributed on an
139
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
140
+ # KIND, either express or implied. See the License for the
141
+ # specific language governing permissions and limitations
142
+ # under the License.
143
+ # ----------------------------------------------------------------------------
144
+
145
+ # ----------------------------------------------------------------------------
146
+ # Apache Maven Wrapper startup batch script, version 3.3.4
147
+ #
148
+ # Optional ENV vars
149
+ # -----------------
150
+ # JAVA_HOME - location of a JDK home dir, required when download maven via java source
151
+ # MVNW_REPOURL - repo url base for downloading maven distribution
152
+ # MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
153
+ # MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
154
+ # ----------------------------------------------------------------------------
155
+
156
+ set -euf
157
+ [ "${MVNW_VERBOSE-}" != debug ] || set -x
158
+
159
+ # OS specific support.
160
+ native_path() { printf %s\\n "$1"; }
161
+ case "$(uname)" in
162
+ CYGWIN* | MINGW*)
163
+ [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
164
+ native_path() { cygpath --path --windows "$1"; }
165
+ ;;
166
+ esac
167
+
168
+ # set JAVACMD and JAVACCMD
169
+ set_java_home() {
170
+ # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
171
+ if [ -n "${JAVA_HOME-}" ]; then
172
+ if [ -x "$JAVA_HOME/jre/sh/java" ]; then
173
+ # IBM's JDK on AIX uses strange locations for the executables
174
+ JAVACMD="$JAVA_HOME/jre/sh/java"
175
+ JAVACCMD="$JAVA_HOME/jre/sh/javac"
176
+ else
177
+ JAVACMD="$JAVA_HOME/bin/java"
178
+ JAVACCMD="$JAVA_HOME/bin/javac"
179
+
180
+ if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
181
+ echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
182
+ echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
183
+ return 1
184
+ fi
185
+ fi
186
+ else
187
+ JAVACMD="$(
188
+ 'set' +e
189
+ 'unset' -f command 2>/dev/null
190
+ 'command' -v java
191
+ )" || :
192
+ JAVACCMD="$(
193
+ 'set' +e
194
+ 'unset' -f command 2>/dev/null
195
+ 'command' -v javac
196
+ )" || :
197
+
198
+ if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
199
+ echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
200
+ return 1
201
+ fi
202
+ fi
203
+ }
204
+
205
+ # hash string like Java String::hashCode
206
+ hash_string() {
207
+ str="${1:-}" h=0
208
+ while [ -n "$str" ]; do
209
+ char="${str%"${str#?}"}"
210
+ h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
211
+ str="${str#?}"
212
+ done
213
+ printf %x\\n $h
214
+ }
215
+
216
+ verbose() { :; }
217
+ [ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
218
+
219
+ die() {
220
+ printf %s\\n "$1" >&2
221
+ exit 1
222
+ }
223
+
224
+ trim() {
225
+ # MWRAPPER-139:
226
+ # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
227
+ # Needed for removing poorly interpreted newline sequences when running in more
228
+ # exotic environments such as mingw bash on Windows.
229
+ printf "%s" "${1}" | tr -d '[:space:]'
230
+ }
231
+
232
+ scriptDir="$(dirname "$0")"
233
+ scriptName="$(basename "$0")"
234
+
235
+ # parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
236
+ while IFS="=" read -r key value; do
237
+ case "${key-}" in
238
+ distributionUrl) distributionUrl=$(trim "${value-}") ;;
239
+ distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
240
+ esac
241
+ done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties"
242
+ [ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
243
+
244
+ case "${distributionUrl##*/}" in
245
+ maven-mvnd-*bin.*)
246
+ MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
247
+ case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
248
+ *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
249
+ :Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
250
+ :Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
251
+ :Linux*x86_64*) distributionPlatform=linux-amd64 ;;
252
+ *)
253
+ echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
254
+ distributionPlatform=linux-amd64
255
+ ;;
256
+ esac
257
+ distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
258
+ ;;
259
+ maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
260
+ *) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
261
+ esac
262
+
263
+ # apply MVNW_REPOURL and calculate MAVEN_HOME
264
+ # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
265
+ [ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
266
+ distributionUrlName="${distributionUrl##*/}"
267
+ distributionUrlNameMain="${distributionUrlName%.*}"
268
+ distributionUrlNameMain="${distributionUrlNameMain%-bin}"
269
+ MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
270
+ MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
271
+
272
+ exec_maven() {
273
+ unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
274
+ exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
275
+ }
276
+
277
+ if [ -d "$MAVEN_HOME" ]; then
278
+ verbose "found existing MAVEN_HOME at $MAVEN_HOME"
279
+ exec_maven "$@"
280
+ fi
281
+
282
+ case "${distributionUrl-}" in
283
+ *?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
284
+ *) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
285
+ esac
286
+
287
+ # prepare tmp dir
288
+ if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
289
+ clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
290
+ trap clean HUP INT TERM EXIT
291
+ else
292
+ die "cannot create temp dir"
293
+ fi
294
+
295
+ mkdir -p -- "${MAVEN_HOME%/*}"
296
+
297
+ # Download and Install Apache Maven
298
+ verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
299
+ verbose "Downloading from: $distributionUrl"
300
+ verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
301
+
302
+ # select .zip or .tar.gz
303
+ if ! command -v unzip >/dev/null; then
304
+ distributionUrl="${distributionUrl%.zip}.tar.gz"
305
+ distributionUrlName="${distributionUrl##*/}"
306
+ fi
307
+
308
+ # verbose opt
309
+ __MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
310
+ [ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
311
+
312
+ # normalize http auth
313
+ case "${MVNW_PASSWORD:+has-password}" in
314
+ '') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
315
+ has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
316
+ esac
317
+
318
+ if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
319
+ verbose "Found wget ... using wget"
320
+ wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
321
+ elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
322
+ verbose "Found curl ... using curl"
323
+ curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
324
+ elif set_java_home; then
325
+ verbose "Falling back to use Java to download"
326
+ javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
327
+ targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
328
+ cat >"$javaSource" <<-END
329
+ public class Downloader extends java.net.Authenticator
330
+ {
331
+ protected java.net.PasswordAuthentication getPasswordAuthentication()
332
+ {
333
+ return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
334
+ }
335
+ public static void main( String[] args ) throws Exception
336
+ {
337
+ setDefault( new Downloader() );
338
+ java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
339
+ }
340
+ }
341
+ END
342
+ # For Cygwin/MinGW, switch paths to Windows format before running javac and java
343
+ verbose " - Compiling Downloader.java ..."
344
+ "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
345
+ verbose " - Running Downloader.java ..."
346
+ "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
347
+ fi
348
+
349
+ # If specified, validate the SHA-256 sum of the Maven distribution zip file
350
+ if [ -n "${distributionSha256Sum-}" ]; then
351
+ distributionSha256Result=false
352
+ if [ "$MVN_CMD" = mvnd.sh ]; then
353
+ echo "Checksum validation is not supported for maven-mvnd." >&2
354
+ echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
355
+ exit 1
356
+ elif command -v sha256sum >/dev/null; then
357
+ if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then
358
+ distributionSha256Result=true
359
+ fi
360
+ elif command -v shasum >/dev/null; then
361
+ if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
362
+ distributionSha256Result=true
363
+ fi
364
+ else
365
+ echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
366
+ echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
367
+ exit 1
368
+ fi
369
+ if [ $distributionSha256Result = false ]; then
370
+ echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
371
+ echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
372
+ exit 1
373
+ fi
374
+ fi
375
+
376
+ # unzip and move
377
+ if command -v unzip >/dev/null; then
378
+ unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
379
+ else
380
+ tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
381
+ fi
382
+
383
+ # Find the actual extracted directory name (handles snapshots where filename != directory name)
384
+ actualDistributionDir=""
385
+
386
+ # First try the expected directory name (for regular distributions)
387
+ if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then
388
+ if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then
389
+ actualDistributionDir="$distributionUrlNameMain"
390
+ fi
391
+ fi
392
+
393
+ # If not found, search for any directory with the Maven executable (for snapshots)
394
+ if [ -z "$actualDistributionDir" ]; then
395
+ # enable globbing to iterate over items
396
+ set +f
397
+ for dir in "$TMP_DOWNLOAD_DIR"/*; do
398
+ if [ -d "$dir" ]; then
399
+ if [ -f "$dir/bin/$MVN_CMD" ]; then
400
+ actualDistributionDir="$(basename "$dir")"
401
+ break
402
+ fi
403
+ fi
404
+ done
405
+ set -f
406
+ fi
407
+
408
+ if [ -z "$actualDistributionDir" ]; then
409
+ verbose "Contents of $TMP_DOWNLOAD_DIR:"
410
+ verbose "$(ls -la "$TMP_DOWNLOAD_DIR")"
411
+ die "Could not find Maven distribution directory in extracted archive"
412
+ fi
413
+
414
+ verbose "Found extracted Maven distribution directory: $actualDistributionDir"
415
+ printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url"
416
+ mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
417
+
418
+ clean || :
419
+ exec_maven "$@"
420
+ <<<ENDFILE>>>
421
+ <<<FILE path="mvnw.cmd">>>
422
+ <# : batch portion
423
+ @REM ----------------------------------------------------------------------------
424
+ @REM Licensed to the Apache Software Foundation (ASF) under one
425
+ @REM or more contributor license agreements. See the NOTICE file
426
+ @REM distributed with this work for additional information
427
+ @REM regarding copyright ownership. The ASF licenses this file
428
+ @REM to you under the Apache License, Version 2.0 (the
429
+ @REM "License"); you may not use this file except in compliance
430
+ @REM with the License. You may obtain a copy of the License at
431
+ @REM
432
+ @REM http://www.apache.org/licenses/LICENSE-2.0
433
+ @REM
434
+ @REM Unless required by applicable law or agreed to in writing,
435
+ @REM software distributed under the License is distributed on an
436
+ @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
437
+ @REM KIND, either express or implied. See the License for the
438
+ @REM specific language governing permissions and limitations
439
+ @REM under the License.
440
+ @REM ----------------------------------------------------------------------------
441
+
442
+ @REM ----------------------------------------------------------------------------
443
+ @REM Apache Maven Wrapper startup batch script, version 3.3.4
444
+ @REM
445
+ @REM Optional ENV vars
446
+ @REM MVNW_REPOURL - repo url base for downloading maven distribution
447
+ @REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
448
+ @REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
449
+ @REM ----------------------------------------------------------------------------
450
+
451
+ @IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
452
+ @SET __MVNW_CMD__=
453
+ @SET __MVNW_ERROR__=
454
+ @SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
455
+ @SET PSModulePath=
456
+ @FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
457
+ IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
458
+ )
459
+ @SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
460
+ @SET __MVNW_PSMODULEP_SAVE=
461
+ @SET __MVNW_ARG0_NAME__=
462
+ @SET MVNW_USERNAME=
463
+ @SET MVNW_PASSWORD=
464
+ @IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*)
465
+ @echo Cannot start maven from wrapper >&2 && exit /b 1
466
+ @GOTO :EOF
467
+ : end batch / begin powershell #>
468
+
469
+ $ErrorActionPreference = "Stop"
470
+ if ($env:MVNW_VERBOSE -eq "true") {
471
+ $VerbosePreference = "Continue"
472
+ }
473
+
474
+ # calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
475
+ $distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
476
+ if (!$distributionUrl) {
477
+ Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
478
+ }
479
+
480
+ switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
481
+ "maven-mvnd-*" {
482
+ $USE_MVND = $true
483
+ $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
484
+ $MVN_CMD = "mvnd.cmd"
485
+ break
486
+ }
487
+ default {
488
+ $USE_MVND = $false
489
+ $MVN_CMD = $script -replace '^mvnw','mvn'
490
+ break
491
+ }
492
+ }
493
+
494
+ # apply MVNW_REPOURL and calculate MAVEN_HOME
495
+ # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
496
+ if ($env:MVNW_REPOURL) {
497
+ $MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" }
498
+ $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"
499
+ }
500
+ $distributionUrlName = $distributionUrl -replace '^.*/',''
501
+ $distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
502
+
503
+ $MAVEN_M2_PATH = "$HOME/.m2"
504
+ if ($env:MAVEN_USER_HOME) {
505
+ $MAVEN_M2_PATH = "$env:MAVEN_USER_HOME"
506
+ }
507
+
508
+ if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
509
+ New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
510
+ }
511
+
512
+ $MAVEN_WRAPPER_DISTS = $null
513
+ if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
514
+ $MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
515
+ } else {
516
+ $MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
517
+ }
518
+
519
+ $MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain"
520
+ $MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
521
+ $MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
522
+
523
+ if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
524
+ Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
525
+ Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
526
+ exit $?
527
+ }
528
+
529
+ if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
530
+ Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
531
+ }
532
+
533
+ # prepare tmp dir
534
+ $TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
535
+ $TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
536
+ $TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
537
+ trap {
538
+ if ($TMP_DOWNLOAD_DIR.Exists) {
539
+ try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
540
+ catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
541
+ }
542
+ }
543
+
544
+ New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
545
+
546
+ # Download and Install Apache Maven
547
+ Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
548
+ Write-Verbose "Downloading from: $distributionUrl"
549
+ Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
550
+
551
+ $webclient = New-Object System.Net.WebClient
552
+ if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
553
+ $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
554
+ }
555
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
556
+ $webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
557
+
558
+ # If specified, validate the SHA-256 sum of the Maven distribution zip file
559
+ $distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
560
+ if ($distributionSha256Sum) {
561
+ if ($USE_MVND) {
562
+ Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
563
+ }
564
+ Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
565
+ if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
566
+ Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
567
+ }
568
+ }
569
+
570
+ # unzip and move
571
+ Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
572
+
573
+ # Find the actual extracted directory name (handles snapshots where filename != directory name)
574
+ $actualDistributionDir = ""
575
+
576
+ # First try the expected directory name (for regular distributions)
577
+ $expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain"
578
+ $expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD"
579
+ if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) {
580
+ $actualDistributionDir = $distributionUrlNameMain
581
+ }
582
+
583
+ # If not found, search for any directory with the Maven executable (for snapshots)
584
+ if (!$actualDistributionDir) {
585
+ Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object {
586
+ $testPath = Join-Path $_.FullName "bin/$MVN_CMD"
587
+ if (Test-Path -Path $testPath -PathType Leaf) {
588
+ $actualDistributionDir = $_.Name
589
+ }
590
+ }
591
+ }
592
+
593
+ if (!$actualDistributionDir) {
594
+ Write-Error "Could not find Maven distribution directory in extracted archive"
595
+ }
596
+
597
+ Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir"
598
+ Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null
599
+ try {
600
+ Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
601
+ } catch {
602
+ if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
603
+ Write-Error "fail to move MAVEN_HOME"
604
+ }
605
+ } finally {
606
+ try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
607
+ catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
608
+ }
609
+
610
+ Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
611
+ <<<ENDFILE>>>
612
+ <<<FILE path="pom.xml">>>
613
+ <?xml version="1.0" encoding="UTF-8"?>
614
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
615
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
616
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
617
+ <modelVersion>4.0.0</modelVersion>
618
+ <parent>
619
+ <groupId>org.springframework.boot</groupId>
620
+ <artifactId>spring-boot-starter-parent</artifactId>
621
+ <version>4.1.0</version>
622
+ <relativePath /> <!-- lookup parent from repository -->
623
+ </parent>
624
+
625
+
626
+
627
+ <!--<groupId>appweaver.foundation</groupId>
628
+ <artifactId>appweaver-hexagonal</artifactId>-->
629
+
630
+ <groupId>io.appweaver</groupId>
631
+ <artifactId>io.appweaver</artifactId>
632
+ <version>0.0.1-SNAPSHOT</version>
633
+ <name />
634
+ <description />
635
+ <url />
636
+ <licenses>
637
+ <license />
638
+ </licenses>
639
+ <developers>
640
+ <developer />
641
+ </developers>
642
+ <scm>
643
+ <connection />
644
+ <developerConnection />
645
+ <tag />
646
+ <url />
647
+ </scm>
648
+ <properties>
649
+ <java.version>21</java.version>
650
+ </properties>
651
+
652
+
653
+ <dependencies>
654
+
655
+ <dependency>
656
+ <groupId>org.springframework.boot</groupId>
657
+ <artifactId>spring-boot-starter-web</artifactId>
658
+ </dependency>
659
+
660
+ <dependency>
661
+ <groupId>org.springframework.boot</groupId>
662
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
663
+ </dependency>
664
+
665
+
666
+ <!-- H2 Database for development -->
667
+
668
+ <dependency>
669
+ <groupId>com.h2database</groupId>
670
+ <artifactId>h2</artifactId>
671
+ <scope>runtime</scope>
672
+ </dependency>
673
+
674
+ <dependency>
675
+ <groupId>org.projectlombok</groupId>
676
+ <artifactId>lombok</artifactId>
677
+ <optional>true</optional>
678
+ </dependency>
679
+
680
+ <dependency>
681
+ <groupId>org.springframework.boot</groupId>
682
+ <artifactId>spring-boot-starter-test</artifactId>
683
+ <scope>test</scope>
684
+ </dependency>
685
+
686
+ </dependencies>
687
+
688
+ <build>
689
+ <plugins>
690
+ <plugin>
691
+ <groupId>org.springframework.boot</groupId>
692
+ <artifactId>spring-boot-maven-plugin</artifactId>
693
+ <configuration>
694
+ <excludes>
695
+ <exclude>
696
+ <groupId>org.projectlombok</groupId>
697
+ <artifactId>lombok</artifactId>
698
+ </exclude>
699
+ </excludes>
700
+ </configuration>
701
+ </plugin>
702
+ <plugin>
703
+ <groupId>org.apache.maven.plugins</groupId>
704
+ <artifactId>maven-compiler-plugin</artifactId>
705
+ <executions>
706
+ <execution>
707
+ <id>default-compile</id>
708
+ <phase>compile</phase>
709
+ <goals>
710
+ <goal>compile</goal>
711
+ </goals>
712
+ <configuration>
713
+ <annotationProcessorPaths>
714
+ <path>
715
+ <groupId>org.projectlombok</groupId>
716
+ <artifactId>lombok</artifactId>
717
+ </path>
718
+ </annotationProcessorPaths>
719
+ </configuration>
720
+ </execution>
721
+ <execution>
722
+ <id>default-testCompile</id>
723
+ <phase>test-compile</phase>
724
+ <goals>
725
+ <goal>testCompile</goal>
726
+ </goals>
727
+ <configuration>
728
+ <annotationProcessorPaths>
729
+ <path>
730
+ <groupId>org.projectlombok</groupId>
731
+ <artifactId>lombok</artifactId>
732
+ </path>
733
+ </annotationProcessorPaths>
734
+ </configuration>
735
+ </execution>
736
+ </executions>
737
+ </plugin>
738
+ </plugins>
739
+ </build>
740
+
741
+ </project>
742
+ <<<ENDFILE>>>
743
+ <<<FILE path="src/main/java/io/appweaver/Application.java">>>
744
+ package io.appweaver;
745
+
746
+ import org.springframework.boot.SpringApplication;
747
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
748
+
749
+ @SpringBootApplication
750
+ public class Application {
751
+
752
+ public static void main(String[] args) {
753
+ SpringApplication.run(Application.class, args);
754
+ }
755
+ }
756
+ <<<ENDFILE>>>
757
+ <<<FILE path="src/main/resources/application.properties">>>
758
+ spring.application.name=io.appweaver
759
+
760
+
761
+ spring.datasource.url=jdbc:h2:file:./data/projectdb
762
+
763
+ spring.datasource.driverClassName=org.h2.Driver
764
+ spring.datasource.username=sa
765
+ spring.datasource.password=
766
+
767
+ spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
768
+ spring.jpa.hibernate.ddl-auto=update
769
+ <<<ENDFILE>>>
770
+ <<<FILE path="src/test/java/io/appweaver/ApplicationTests.java">>>
771
+ package io.appweaver;
772
+
773
+ import org.junit.jupiter.api.Test;
774
+ import org.springframework.boot.test.context.SpringBootTest;
775
+
776
+ @SpringBootTest
777
+ class ApplicationTests {
778
+
779
+ @Test
780
+ void contextLoads() {
781
+ }
782
+
783
+ }
784
+ <<<ENDFILE>>>