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

We Are Going To Discuss About Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain. So lets Start this Java Article.

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

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

    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.

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

    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.

Solution 1

Advertisements

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.

Original Author Oleksii Volynskyi Of This Content

Solution 2

Advertisements

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.

Original Author Phil Webb Of This Content

Solution 3

Advertisements

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.

Original Author HelloWorld Of This Content

Solution 4

Advertisements

i actually did just mvn clean install and it worked, i am actually using older version of spring 2.0 to be specific

Original Author Badmous Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment