2
2
.
.
1
1
.
.
3
3
S
S
p
p
r
r
i
i
n
n
g
g
B
B
o
o
o
o
t
t
P
P
r
r
o
o
j
j
e
e
c
c
t
t
I
I
n
n
f
f
o
o
Created Spring Boot Project will contain (there are no JARs or other Java Classes)
Directory Structure (with configuration files like pom.xml and DemoApplication.java)
DemoApplication.java (entry point to our application - Java Class with main method)
pom.xml (with selected dependencies: Spring Web, Spring Data JPA, H2 Database)
Depending on the edition of IntelliJ IDEA you can Create Spring Boot Project in two ways
Using IntelliJ Community Edition (use https://start.spring.io Web Application to create & download project)
Using IntelliJ Ultimate Edition (IntelliJ uses https://start.spring.io Web Application in the background)
Directory Structure
DemoApplication.java
package com.ivoronline.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
pom.xml (partial content)
<?xml version="1.0" encoding="UTF-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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.11.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.ivoronline</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>