So here's a new one, for me… I'm working with one of the Spring Boot guides, and getting the
Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain
error when running
./mvnw spring-boot:run
(or any Maven Wrapper command)
That said, I see the wrapper
jar within .mvn
where I would expect it to be.
Has anyone else hit this? It seems like it must be a system-level issue because I've had no issue with this in the past.
Here is the repo I am running this command on: https://github.com/spring-guides/gs-scheduling-tasks.git
2 Answers
Answers 1
Initial project is an empty project so when you run ./mvnw spring-boot:run
in this folder the message is clear and tells you that there is no main class in the project to run as a Spring Boot application.
If you run the command in the complete folder you run the project which has all the logic of the tutorial.
If you cd in the root folder and you run mvnw from inside complete or initial folders you get that message because it is like you cd to a completely irrelevant folder like /test/project (you can try that).
What mvnw does is tries to find and run a .pom file where in all folders except for complete and initial is not present.
Answers 2
try to delete it from .m2 directory and rebuild again, i once had a similar problem and solved only when i deleted the jar from .m2 and rebuild it again
0 comments:
Post a Comment