]> juplo.de Git - maven-thymeleaf-skin/commitdiff
Fix mvnw: pass MAVEN_OPTS as env var, not as command-line args
authorKai Moritz <kai.milan.moritz@googlemail.com>
Wed, 17 Jun 2026 19:06:31 +0000 (19:06 +0000)
committerKai Moritz <kai.milan.moritz@googlemail.com>
Wed, 17 Jun 2026 19:06:31 +0000 (19:06 +0000)
MAVEN_OPTS contains JVM flags (e.g. -Xms256m -Xmx512m). Passing them
as positional arguments to mvn causes Maven to interpret them as unknown
lifecycle phases. Fix: export MAVEN_OPTS so Maven reads and forwards it
to the JVM itself, as intended.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mvnw

diff --git a/mvnw b/mvnw
index d8fd9d838b5be2d63fe4d1e9a583083a277b84d6..c1aa4ab84d0f0d23ae9b4c8c19e0ce396d0fff30 100755 (executable)
--- a/mvnw
+++ b/mvnw
@@ -197,7 +197,6 @@ if [ ! -x "$MAVEN_HOME/bin/mvn" ]; then
 fi
 
 export MAVEN_HOME
+export MAVEN_OPTS
 
-exec "$MAVEN_HOME/bin/mvn" \
-  ${MAVEN_OPTS} \
-  "$@"
+exec "$MAVEN_HOME/bin/mvn" "$@"