File tree 1 file changed +16
-2
lines changed
maven-wrapper-distribution/src/resources 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,24 @@ if ($env:MVNW_REPOURL) {
78
78
}
79
79
$distributionUrlName = $distributionUrl -replace '^ .*/',''
80
80
$distributionUrlNameMain = $distributionUrlName -replace '\.[^ .]*$','' -replace '-bin$',''
81
- $MAVEN_HOME_PARENT = " $HOME/.m2/wrapper/dists/$distributionUrlNameMain"
81
+
82
+ $MAVEN_M2_PATH = " $HOME/.m2"
82
83
if ($env:MAVEN_USER_HOME) {
83
- $MAVEN_HOME_PARENT = " $env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
84
+ $MAVEN_M2_PATH = " $env:MAVEN_USER_HOME"
85
+ }
86
+
87
+ if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
88
+ New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
84
89
}
90
+
91
+ $MAVEN_WRAPPER_DISTS = $null
92
+ if ((Get-Item $MAVEN_M2_PATH).Target -eq $null) {
93
+ $MAVEN_WRAPPER_DISTS = " $MAVEN_M2_PATH/wrapper/dists"
94
+ } else {
95
+ $MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + " /wrapper/dists"
96
+ }
97
+
98
+ $MAVEN_HOME_PARENT = " $MAVEN_WRAPPER_DISTS/$distributionUrlNameMain"
85
99
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString(" x2" )}) -join ''
86
100
$MAVEN_HOME = " $MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
87
101
You can’t perform that action at this time.
0 commit comments