Improve local setup and Maven wrapper
This commit is contained in:
+25
-2
@@ -6,15 +6,38 @@ lefthook = "1.11.12"
|
||||
gitleaks = "8.26.0"
|
||||
|
||||
[tasks.setup]
|
||||
description = "Install deps and git hooks"
|
||||
description = "Install deps, git hooks, env file, and validate local toolchain"
|
||||
run = """
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
if ! command -v java >/dev/null 2>&1; then
|
||||
echo "ERROR: Java 21 JDK not found. Run 'mise install' first, or install OpenJDK 21 and set JAVA_HOME." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
java_major="$(java -XshowSettings:properties -version 2>&1 | awk -F= '/java.specification.version/ { gsub(/[[:space:]]/, "", $2); print $2; exit }')"
|
||||
if [ "${java_major}" != "21" ]; then
|
||||
echo "ERROR: Java 21 is required, but found Java ${java_major}. Run 'mise install' or set JAVA_HOME to a Java 21 JDK." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Prime and validate the Maven wrapper cache so backend startup does not fail later.
|
||||
backend/mvnw -f backend/pom.xml -v >/dev/null
|
||||
|
||||
npm --prefix frontend install
|
||||
lefthook install
|
||||
cp -n .env.example .env 2>/dev/null || true
|
||||
"""
|
||||
|
||||
[tasks.backend]
|
||||
description = "Run the Spring Boot backend"
|
||||
run = "backend/mvnw -f backend/pom.xml spring-boot:run"
|
||||
|
||||
[tasks.frontend]
|
||||
description = "Run the Vite frontend"
|
||||
run = "npm --prefix frontend run dev"
|
||||
|
||||
[tasks.check]
|
||||
description = "Format-check, lint, and test"
|
||||
run = """
|
||||
|
||||
Reference in New Issue
Block a user