Springboot Maven plugin


Less nonsense. Add the following code to the pom.xml file. Don’t look at the following


spring-boot-maven-pluginofgoals, there are five optional values


Packaging legend:





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 firstmvn compile, and then run another onemvn package spring-boot:repackageSay it first. I’m not sure. I haven’t tried. Bye

Add: what? You said you wanted to delve into this?
Then go and see thisOfficial documentsAh, really!
You can also look at thisSpring boot Maven plugin of Maven plug-in series

Recommended Today

Go reflection class instance

Internal mechanism of variables Type information: static meta information, predefined Value information: it is dynamically changed during program operation Use of reflection Get type information: reflect.typeof, which is static Get value information: reflect.valueof, which is dynamic Get interface value information by reflection package main import ( “fmt” “reflect” ) //Get interface value information by reflection […]