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

时间:2018-03-22 23:54:06

标签: 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?

1 个答案:

答案 0 :(得分:4)

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