Step 0 - Verify java
& mvn
are installed on the system
$ java -version
$ mvn -version
Step 1 - Generate simple maven archetype project
$ mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
Step 2 - Configure maven compiler plugin
<properties >
<maven .compiler.source>1.8</maven .compiler.source>
<maven .compiler.target>1.8</maven .compiler.target>
</properties >
Step 3 - Inherit spring-boot parent
<parent >
<groupId >org.springframework.boot</groupId >
<artifactId >spring-boot-starter-parent</artifactId >
<version >2.0.3.RELEASE</version >
</parent >
Step 4 - Add spring-boot starter pack (for e.g *-web)
<dependency >
<groupId >org.springframework.boot</groupId >
<artifactId >spring-boot-starter-web</artifactId >
</dependency >
Step 5 - Setup spring-boot build plugin
<build >
<plugins >
<plugin >
<groupId >org.springframework.boot</groupId >
<artifactId >spring-boot-maven-plugin</artifactId >
</plugin >
</plugins >
</build >
Step 6 - Springify the app with @SpringBootApplication
@ SpringBootApplication
public class App {
public static void main (String [] args ) {
SpringApplication .run (App .class , args );
}
}
$ mvn clean install
$ java -jar target\m y-app-* .jar