You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MWRAPPER-160] Wrapper fails for Maven >= 4.0.0-beta-5 #325
Wrapper types source, bin and script fail for Maven versions 4.0.0-beta-5 and 4.0.0-rc-2. I haven't tested the other versions in between, but I guess they fail too.
Fails both for mvnw and mvnw.cmd.
The failure is not reproduced when using type only-script, so I guess the problem is in the wrapper jar.
This is the failure:
!error.png!
This is working correctly for Maven 4.0.0-beta-4:
!correct.png!
This is working correctly for type only-script and Maven 4.0.0-beta-5.
maven main now is selective for maven 4. IMO maven should default inside itself instead of throwing the error which is affecting maven wrapper. The script in beta-5 and above has this fall back.
if "%MAVEN_MAIN_CLASS%"=="" @set MAVEN_MAIN_CLASS=org.apache.maven.cling.MavenCling
If you add that to the mvnw file just before the maven execution and then add
Activity
hazendaz commentedon Jun 26, 2025
still a problem with 4.0.0-rc-4
testing on my local windows 11, running the wrapper does download the jar file, does download the distribution. It fails to use it though.
hazendaz commentedon Jun 26, 2025
Found the issue.
maven main now is selective for maven 4. IMO maven should default inside itself instead of throwing the error which is affecting maven wrapper. The script in beta-5 and above has this fall back.
If you add that to the mvnw file just before the maven execution and then add
To the actual call, it then works.
estekhin commentedon Oct 22, 2025
There is a discussion https://lists.apache.org/thread/jnb3snhdm4b564gz8hbctp9rfk8fc67n about releasing Maven 4.0.0, and it would be wonderful if wrapper of any type was ready to work with it.