to create an executable jar, we need to add spring-boot-maven-plugin
to our pom.xml
. To do this, dependencies
Insert the following lines directly below the section :
1 2 3 4 5 6 7 8 </build>
not everyone likes to go from spring-boot-starter-parent
POM inheritance . You may have your own corporate standard parents that you need to use or you might prefer to explicitly declare all MAVEN configurations.
If you don't want to use it spring-boot-starter-parent
, you can still use a scope=import
Dependencies to maintain the benefits of dependency management (rather than plug-in management) , as follows:
1<dependencyManagement>2<dependencies>3<dependency>4<!--Import Dependency Management from Spring Boot--5<groupId>org.springframework.boot</groupId>6<artifactId>spring-boot-dependencies</artifactId>7<version>2.0.0.BUILD-SNAPSHOT</version>8<type>pom</type>9<scope>Import</scope>Ten</dependency> One</dependencies> A</dependencyManagement>
To create an executable jar, we need to add spring-boot-maven-plugin to our pom.xml. To do this, insert the following lines directly below the dependencies section: