Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

jhipster

I created two JHipster projects, the same way, a gateway and a microservice. The microservice has nothing wrong, however whene I try to run ./mvnw clean install in the gateway root I get the following error:

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

The only way I found to fix this is to copy the maven-wrapper.jar from .mvnw/wrapper of the microservice app to the gateway. Of course I think there should be a better way to fix this. Any idea?

like image 682
1Z10 Avatar asked Mar 22 '18 23:03

1Z10


1 Answers

My guess is that you copied mvnw from somewhere else. That will not work because, as you mentioned, the dependencies of the script are not properly set up.

Run mvn -N io.takari:maven:wrapper at the root of your projects.

https://github.com/takari/takari-maven-plugin

like image 99
pikachu0 Avatar answered Nov 17 '22 05:11

pikachu0