Search

VSCODE Spring Boot ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ

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