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
Maven wrapper broken with maven 4.0.0-beta-5 and above (solved issue included) #2520
Maven 4.0.0-beta-5 and above changed to use selective MAVEN_MAIN_CLASS. Because maven wrapper very closely mimics mavens own mvn and mvn.cmd, any changes would need ported to the maven wrapper. However, to some degree that breaks backwards compatibility since its a maven 4 item only but would work by fixing wrapper as noted (probably more than I did). I think it would be better though to add the defaulting when missing inside maven itself rather than expect the script pass a defaulted value along so that there is no breaking maven wrapper.
This line
if "%MAVEN_MAIN_CLASS%"=="" @set MAVEN_MAIN_CLASS=org.apache.maven.cling.MavenCling
Can we do this inside maven itself when missing instead? That would immediately fix the maven wrapper issue. Since its the internals throwing errors, I suspect that answer is yes.
This is currently out of control from Maven. Maven uses plexus classworlds to bootstrap the java JVM and it does not seem a good idea to make it dependant on Maven. I'm investigating replacing it, so this may be an opportunity to fix it, but not short term.
The locations inside maven already default to org.apache.maven.cling.MavenCling, but unfortunately, none of them is in java, as they are in the shell scripts and in the m2.conf.
Activity
DidierLoiseau commentedon Jul 7, 2025
This looks similar to the issue I was mentioning in #1750 (comment)
To which @gnodet replied with:
gnodet commentedon Oct 10, 2025
This is currently out of control from Maven. Maven uses plexus classworlds to bootstrap the java JVM and it does not seem a good idea to make it dependant on Maven. I'm investigating replacing it, so this may be an opportunity to fix it, but not short term.
The locations inside maven already default to
org.apache.maven.cling.MavenCling, but unfortunately, none of them is in java, as they are in the shell scripts and in them2.conf.Fix apache#2520: default maven.mainClass in Java instead of classworl…
Fix #2520: default maven.mainClass in Java instead of classworlds con…