VSCODE Spring Boot ํ๋ก์ ํธ ์์ฑ
โข
Create Spring Initailizer
โข
index.html ๋ฉ์ธ ํ์ด์ง ์์ฑ
โข
ํ๋ก์ ํธ ์คํ
โข
๋ธ๋ผ์ฐ์ ์คํ
โข
์ธ๋ถ ๋ธ๋ผ์ฐ์ ์ค์
Create Spring Initailizer
1.
๋ช
๋ น ํ๋ ํธ (ctrl + shift + P)
2.
Create Spring Initailizer
Create Spring Initailizer
Plain Text
๋ณต์ฌ
Create Spring Initailizer
โข
version : 3.x.x
โข
language : Java
โข
Group Id : com.example
โข
Artifact Id : demo
โข
Packaging Type : War
โข
Java Version : 17
โข
Dependencies
โฆ
Spring Web
โฆ
SpringBoot DevTools
โฆ
Thymeleaf
version : 3.x.x
language : Java
Group Id : com.example
Artifact Id : demo
Packaging Type : War
Java Version : 17
Dependencies
โข
Spring Web
โข
SpringBoot DevTools
โข
Thymeleaf
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
Plain Text
๋ณต์ฌ
Spring Web
SpringBoot DevTools
Thymeleaf
builde.gradle
plugins {
id 'java'
id 'war'
id 'org.springframework.boot' version '3.2.5'
id 'io.spring.dependency-management' version '1.1.4'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
}
Plain Text
๋ณต์ฌ
index.html ๋ฉ์ธ ํ์ด์ง ์์ฑ
โข
resources/templates/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>๋ฉ์ธ ํ๋ฉด</title>
</head>
<body>
<h1>Hello Spring Boot~!</h1>
<h3>ALOHA CLASS</h3>
</body>
</html>
HTML
๋ณต์ฌ
ํ๋ก์ ํธ ์คํ
1.
Spring Dash Board
2.
Run (
)
๋ธ๋ผ์ฐ์ ์คํ
์ธ๋ถ ๋ธ๋ผ์ฐ์ ์ค์
1.
์ค์ (ctrl + ,)
2.
spring dashboard > Open with
a.
external