Skip to content

Commit 5a67bf8

Browse files
authored
Fixup MAVEN_CONFIG environment variable to not collide with mvnw wrapper (#462)
Fixes #457
1 parent 3dc84d9 commit 5a67bf8

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"http_proxy": "${localEnv:http_proxy}",
3333
"https_proxy": "${localEnv:https_proxy}",
3434
"no_proxy": "${localEnv:no_proxy}",
35-
"MAVEN_CONFIG": "${localEnv:HOME}/.m2",
35+
"MAVEN_CONFIG_DIR": "${localEnv:HOME}/.m2",
3636
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}",
3737
"CONTAINER_WORKSPACE_FOLDER": "${containerWorkspaceFolder}"
3838
},

docker/benchbase/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ docker pull benchbase.azurecr.io/benchbase-dev
7575
docker run -it --rm -v /path/to/src:/benchbase benchbase.azurecr.io/benchbase-dev
7676
```
7777

78-
> Optional: also reuse the local `MAVEN_CONFIG` and it's repository download cache with the following argument:
78+
> Optional: also reuse the local `MAVEN_CONFIG_DIR` and it's repository download cache with the following argument:
7979
>
80-
> `-v "${MAVEN_CONFIG:-$HOME/.m2}:/home/containeruser/.m2"`
80+
> `-v "${MAVEN_CONFIG_DIR:-$HOME/.m2}:/home/containeruser/.m2"`
8181
8282
```sh
8383
docker pull benchbase.azurecr.io/benchbase

docker/benchbase/devcontainer/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ RUN groupadd --non-unique --gid ${CONTAINERUSER_GID} containergroup \
2020
&& echo 'containeruser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
2121
RUN mkdir -p /benchbase/results && chown -R containeruser:containergroup /benchbase/
2222
USER containeruser
23-
ENV MAVEN_CONFIG=/home/containeruser/.m2
23+
# Unset the upstream MVN_CONFIG value - it interacts poorly with the mvnw wrapper.
24+
ENV MAVEN_CONFIG=
25+
ENV MAVEN_CONFIG_DIR=/home/containeruser/.m2
2426
WORKDIR /benchbase
2527
VOLUME /benchbase/results
2628

docker/benchbase/run-dev-image.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ else
2626
fi
2727

2828
cd "$rootdir"
29-
MAVEN_CONFIG="${MAVEN_CONFIG:-$HOME/.m2}"
30-
mkdir -p "$MAVEN_CONFIG" || true
29+
MAVEN_CONFIG_DIR="${MAVEN_CONFIG_DIR:-$HOME/.m2}"
30+
mkdir -p "$MAVEN_CONFIG_DIR" || true
3131
set -x
3232
SRC_DIR="${LOCAL_WORKSPACE_FOLDER:-$PWD}"
3333
docker run ${INTERACTIVE_ARGS:-} --rm \
@@ -39,5 +39,5 @@ docker run ${INTERACTIVE_ARGS:-} --rm \
3939
--env DO_FORMAT_CHECKS="$DO_FORMAT_CHECKS" \
4040
--env EXTRA_MAVEN_ARGS="${EXTRA_MAVEN_ARGS:-}" \
4141
--user "$CONTAINERUSER_UID:$CONTAINERUSER_GID" \
42-
-v "$MAVEN_CONFIG:/home/containeruser/.m2" \
42+
-v "$MAVEN_CONFIG_DIR:/home/containeruser/.m2" \
4343
-v "$SRC_DIR:/benchbase" benchbase-dev:latest $*

0 commit comments

Comments
 (0)