Skip to content

Commit

Permalink
[MWRAPPER-146] Bad substitution on Windows if MVNW_REPOURL is set on …
Browse files Browse the repository at this point in the history
…script-only (#151)

USE_MVND evaluation is incorrect, string substitution of distributionUrl is incorrect
  • Loading branch information
jahk04 authored Dec 16, 2024
1 parent 430fd0c commit 7af7d15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maven-wrapper-distribution/src/resources/only-mvnw.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
$MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
Expand Down

0 comments on commit 7af7d15

Please sign in to comment.