Less nonsense. Add the following code to the pom.xml file. Don’t look at the following
org.springframework.boot spring-boot-maven-plugin 2.0.1.RELEASE repackage
goals, there are five optional values
run start stop build-info
Generally speaking, I use the default value, so just stick it.
*If you do not write this and directly MVN package, the generated jar / war will not run
This is because the package of MVN package does not have dependencies, and the class will not be found at that time
Add: how does this thing work?
I used idea anyway, and I found the Maven tab directly on the right side,
Then click lifecycle, and then click clean – “compile -” package,
Then you can.
If you really feel itchy and want to operate by yourself, you can run it under the project first
mvn compile, and then run another one
mvn package spring-boot:repackage，Say it first. I’m not sure. I haven’t tried. Bye。