Skip to content

[MWRAPPER-160] Wrapper fails for Maven >= 4.0.0-beta-5 #325

Open

Description

@jira-importer

Juan Farré opened MWRAPPER-160 and commented

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.

!correctOnlyScript.PNG!


Affects: 3.3.2

Attachments:

Activity

  1. added
    bug
    priority:major
    on Jun 14, 2025
  2. hazendaz commented on Jun 26, 2025

    @hazendaz
    Contributor

    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.

  3. hazendaz commented on Jun 26, 2025

    @hazendaz
    Contributor

    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 "%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

      "-Dmaven.mainClass=%MAVEN_MAIN_CLASS%" ^
    

    To the actual call, it then works.

  4. estekhin commented on Oct 22, 2025

    @estekhin

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:major

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions