From a7d791b4a26962cbab27b03a98df650537b26b2c Mon Sep 17 00:00:00 2001 From: jdalton Date: Sat, 1 Aug 2026 00:28:29 -0400 Subject: [PATCH] fix(manifest): keep the Maven extension build out of the developer's home directory The maven-extension jar build invoked the bundled Maven wrapper with no repository override, so every run downloaded the plugin and dependency closure into the developer's ~/.m2/repository and the Maven distribution into ~/.m2/wrapper/dists. Point both at a stable directory under the OS temp dir instead. The path is stable rather than per-run so the closure stays cached between builds; SOCKET_CLI_MAVEN_HOME overrides it for a genuinely cold build. --- .../manifest/scripts/maven-extension/build-jar.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/manifest/scripts/maven-extension/build-jar.sh b/packages/cli/src/commands/manifest/scripts/maven-extension/build-jar.sh index eeaef2f67..5ca607bd8 100755 --- a/packages/cli/src/commands/manifest/scripts/maven-extension/build-jar.sh +++ b/packages/cli/src/commands/manifest/scripts/maven-extension/build-jar.sh @@ -5,6 +5,18 @@ set -euo pipefail here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -( cd "$here" && ./mvnw -q --batch-mode package ) + +# Keep the downloaded artifacts and the Maven distribution out of the developer's ~/.m2. The path is +# stable so the plugin closure stays cached between runs; point SOCKET_CLI_MAVEN_HOME elsewhere for a +# cold build. +tmp_root="${TMPDIR:-/tmp}" +maven_home="${SOCKET_CLI_MAVEN_HOME:-${tmp_root%/}/socket-cli-maven-home}" +mkdir -p "$maven_home" + +( + cd "$here" + MAVEN_USER_HOME="$maven_home" ./mvnw -q --batch-mode \ + -Dmaven.repo.local="$maven_home/repository" package +) cp -f "$here/target/coana-maven-extension.jar" "$here/coana-maven-extension.jar" echo "Coana Maven extension jar: $here/coana-maven-extension.jar"