Solution to the dependency problem of creating project package by spring boot
Today, I tampered with the spring boot. According to the case on the official website, I found that there was a problem with the local package dependency and it could not be started. I stepped on the Maven pit all day and recorded this bloody lesson.
1. Spring core dependency package problem
Run the application and find the missing dependent spring core package:
However, the packages of spring boot are introduced through the starter of the parent. View the jar dependency information of the project through MVN dependency: tree:
I spent an afternoon trying various methods, including changing the JDK and Maven version, which could not solve the problem. Finally, I found that the problem was solved by deleting the relevant local Maven jar package, downloading it again, updating the project dependency. There should be a problem with the network in the afternoon. During that time, springboot was often inaccessible!
2. Project spring core dependency problem solving, startup or error reporting
Execute MVN spring: boot run in CMD, but find the error message strangely:
Through the previous experience of solving the abnormal downloading package of spring core due to the network, I felt at the first time that the current error is also related to the plug-in package. This time, I simply deleted all the packages of Maven's repository, updated the dependencies, and re downloaded the jar package. As a result, the problems were solved and the startup was successful:
Open browser: http://localhost:8080
Summary: Although Maven construction project brings a lot of convenience to the development, avoiding the bloated jar package and project sub module management, at the same time, its construction problems have always been criticized by everyone, so if there are problems in use, try to start with the jar package, and don't easily change the program or framework!
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.