fp024 commented on PR #143:
URL: https://github.com/apache/maven-wrapper/pull/143#issuecomment-2143129380

   hello.
   
   I received a GitHub Action build failure email and checked the code again.
   
   Here's what I saw in PowerShell ISE after separating that part:
   
   ```powershell
   # Set MAVEN_USER_HOME manually
   # $env:MAVEN_USER_HOME="D:/MAVEN2/.m2"
   $env:MAVEN_USER_HOME=$null
   
   $MAVEN_M2_PATH = "$HOME/.m2"
   if ($env:MAVEN_USER_HOME) {
     $MAVEN_M2_PATH = "$env:MAVEN_USER_HOME"
   }
   Write-Output "MAVEN_M2_PATH: $MAVEN_M2_PATH"
   
   if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
       New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
   }
   
   $MAVEN_WRAPPER_DISTS = $null
   if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) { # πŸ’‘Re-edited part
     Write-Output "is null: actual path"
     $MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
     Write-Output "MAVEN_WRAPPER_DISTS: $MAVEN_WRAPPER_DISTS"
   } else {
     $MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + 
"/wrapper/dists"
     Write-Output "not null: junction path -> actual path"
     Write-Output "MAVEN_WRAPPER_DISTS: $MAVEN_WRAPPER_DISTS"
   }
   
   ```
   
   
   
   ### When MAVEN_USER_HOME is not set as an environment variable
   
   * MAVEN_M2_PATH="HOME/.m2"
   
   
![image-20240601082911919](https://github.com/apache/maven-wrapper/assets/42864970/13c05494-0117-4a7a-b323-c77b86207d3f)
   
   * `C:\Users\{UserName}/.m2` is the junction path
     * `G:\Maven\m2/wrapper/dists` is the actual path
     * The actual path to the picture in the first comment is incorrect: my 
actual path environment is `G:\Maven\m2`, not `G:\Maven\.m2`.
   
   ### When MAVEN_USER_HOME is set as an environment variable
   
   * MAVEN_M2_PATH="D:/MAVEN2/.m2"
     * `D:/MAVEN2/.m2` is the actual path
   
   
![image-20240601083148668](https://github.com/apache/maven-wrapper/assets/42864970/e1b424d3-2c12-4b85-a87d-3105e484f92e)
   
   * Compared to the first uploaded commit, we changed it to always check the 
junction link condition with Target[0].
     * 
https://github.com/apache/maven-wrapper/compare/eaddcc6d7d1490059e286eef80a2176e560e3d6e..cefb22592fe3397c7652bc3a3866bd73cf5ec8c5
   
   
   
   thank you πŸ‘


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to