Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain

For anyone using Windows seeing this error, check if the .mvn folder files got converted to CRLF. If so, changing them to LF will likely fix your problem.


Phil's answer is correct. And here is how to create .mvn directory with needed jar inside.
I found the answer here (https://www.baeldung.com/maven-wrapper)

If you have maven and you want to make maven wrapper working, you need to setup maven wrapper:

mvn -N io.takari:maven:wrapper

It should create .mvn directory and put needed jar in it.


You're missing the .mvn folder in your git repository. You should have a folder called .mvn which contains the files wrapper/maven-wrapper.jar, wrapper/maven-wrapper.properties and jvm.config. Perhaps you missed it because it's a hidden folder.

Try doing git add -f .mvn from the command line then commit and push.