naotsugu commented on issue #395:
URL: https://github.com/apache/maven-wrapper/issues/395#issuecomment-4046354842

   
   The modifications were reflected in `mvnw.cmd` in the Jenkins workspace, and 
I confirmed that the previously reported error has been resolved.
   This issue is now considered resolved.
   Thank you ☺️
   
   <hr/>
   
   However, although the script error was fixed, I encountered a "Could not 
find or load main class org.codehaus.plexus.classworlds.launcher.Launcher" 
error, and the build could not be completed.
   
   The environment is Windows Server 2022 Datacenter 21H2, and environment 
variables such as `M2_HOME`, `M2`, and `MAVEN_USER_HOME` are not set.
   
   The command executed from `mvnw.cmd` is as follows:
   
   ```
   
C:\WINDOWS\system32\config\systemprofile\.m2\wrapper\dists\apache-maven-3.9.11\03d7e36a140982eea48e22c1dcac01d8862b2550b2939e09a0809bbc5182a5bc\bin\mvn.cmd
   ```
   
   When I execute the following in the Jenkins "Execute Windows batch command" 
step, I get the "Could not find or load main class 
org.codehaus.plexus.classworlds.launcher.Launcher" error:
   
   ```
   mvnw clean package
   ```
   
   If I set `MAVEN_USER_HOME` as follows, the build succeeds:
   
   ```
   set MAVEN_USER_HOME=%WORKSPACE%\.m2
   mvnw clean package
   ```
   
   There might be some restrictions on the `systemprofile` system folder, or 
the path to `mvn.cmd` might be too long.
   I have not investigated the detailed cause.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to