Creating
Step 1) Select project type.

Step 2) Select project name and location.

Step 3) Configure the project by providing Group Id, Artifact Id and Project name.

Step 4) After clicking finish,

This Maven project has a
pom.xml
0 1 2 3 4 5 6 7 8 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.codeNuclear</groupId> <artifactId>spring-boot-example</artifactId> <version>0.0.1-SNAPSHOT</version> <name>Spring Boot Example</name> </project> |
We need to configure it in order to make it a
0 1 2 3 4 5 6 |
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.2.RELEASE</version> </parent> |
After that add the following dependency to the
0 1 2 3 4 5 6 7 |
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> |
After that add Java version for the project.
0 1 2 3 4 |
<properties> <java.version>1.8</java.version> </properties> |
Step 5) Now, our project should have the following directly structure. You can notice that maven has created a new dependency folder to store the jar files.

Step 6) Update Maven project each time after including new dependencies.


Step 7) After updating Maven. Now, Create a Java class inside the

After creating class call the static run method of SpringApplication class. In the following code, we are calling run method and passing class name as argument.
SpringBootExample.java
0 1 2 3 4 5 6 7 8 9 10 11 12 |
package com.javatpoint; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication publicclass SpringBootExample { publicstaticvoid main(String[] args) { SpringApplication.run(SpringBootExample.class, args); } } |
Step 8) Now, run this class as a Java Application.

Step 9) Its displays following output:

The line
Yeah bookmaking this wasn’t a risky decision outstanding post! .
Highly descriptive blog, I liked that a lot. Will there be a part 2?|