1 Commits
1.1.0 ... main

Author SHA1 Message Date
lucasdpt
d8990636a3 feat: add MAVEN_SETTINGS_PATH
All checks were successful
Release / release (push) Successful in 3m2s
2025-11-24 12:45:04 +01:00
2 changed files with 5 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ Environment variables
- `MAVEN_SETTINGS_BASE64` (preferred): base64-encoded contents of the `settings.xml`. If present, the entrypoint will decode it and write it to `~/.m2/settings.xml`.
- `MAVEN_SETTINGS`: raw contents of the `settings.xml`. Used only if `MAVEN_SETTINGS_BASE64` is not set.
- `MAVEN_SETTINGS_PATH`: path to the `settings.xml` inside the container (exported by the entrypoint). Typically `/home/ci/.m2/settings.xml` or `~/.m2/settings.xml` depending on the user; use this variable in scripts to locate the file reliably.
Notes
- The entrypoint will create `~/.m2` if it does not exist and set the `settings.xml` file to mode `644`.
- Use `MAVEN_SETTINGS_BASE64` when your CI system has trouble preserving newlines or special characters in environment variables.

View File

@@ -6,6 +6,9 @@ set -euo pipefail
# then exec the container command.
M2_DIR="${HOME:-/root}/.m2"
SETTINGS_FILE="$M2_DIR/settings.xml"
# Export the path to the settings.xml so downstream processes can read it
export MAVEN_SETTINGS_PATH="$SETTINGS_FILE"
if [[ -n "${MAVEN_SETTINGS_BASE64:-}" ]]; then
mkdir -p "$M2_DIR"