Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apache-maven/src/bin/mvn
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,14 @@ find_file_argument_basedir() {
)
}

# concatenates all lines of a file
# concatenates all lines of a file and replaces variables
concat_lines() {
if [ -f "$1" ]; then
echo "`tr -s '\r\n' ' ' < "$1"`"
# First transform line endings to spaces
content=$(tr -s '\r\n' ' ' < "$1")
# Handle both ${var} and $var formats, only substitute MAVEN_PROJECTBASEDIR
echo "$content" | sed -e "s|\${MAVEN_PROJECTBASEDIR}|$MAVEN_PROJECTBASEDIR|g" \
-e "s|\$MAVEN_PROJECTBASEDIR|$MAVEN_PROJECTBASEDIR|g"
fi
}

Expand Down
8 changes: 7 additions & 1 deletion apache-maven/src/bin/mvn.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,13 @@ set "jvmConfig=\.mvn\jvm.config"
if not exist "%MAVEN_PROJECTBASEDIR%%jvmConfig%" goto endReadAdditionalConfig

@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
set JVM_CONFIG_MAVEN_OPTS=
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do (
set "line=%%a"
set "line=!line:$MAVEN_PROJECTBASEDIR=%MAVEN_PROJECTBASEDIR%!"
set "line=!line:${MAVEN_PROJECTBASEDIR}=%MAVEN_PROJECTBASEDIR%!"
set JVM_CONFIG_MAVEN_OPTS=!JVM_CONFIG_MAVEN_OPTS! !line!
)
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%

:endReadAdditionalConfig
Expand Down
Loading