2025-05-02
main()
๋ฉ์๋ ํ๋๋ก ์๋ฒ ์คํ ๊ฐ๋ฅํ๋ฉฐ, '์ค์ ๋ณด๋ค ๊ด๋ก(Convention over Configuration)' ์์น์ ๋ฐ๋ฅธ๋ค.File โ Settings (macOS: Preferences)
์์ ๋ค์ ์ค์ ์ถ์ฒ:Project Structure โ Project SDK
: JDK 17 ์ด์ ์ค์ plugins {
id 'java'
id 'war' // WAR ํจํค์ง
id 'org.springframework.boot' version '3.4.5'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
// ์คํ๋ง ์น ์คํํฐ
implementation 'org.springframework.boot:spring-boot-starter-web'
// Lombok ์ค์
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// ํ
์คํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// JSP ์ค์
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
// JSTL ์ค์ (Spring Boot 3 ์ด์์ Jakarta EE ์ฌ์ฉ)
implementation 'jakarta.servlet:jakarta.servlet-api' // jakarta ๋ค์์คํ์ด์ค๋ก ๋ณ๊ฒฝ๋จ
implementation 'jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api'
implementation 'org.glassfish.web:jakarta.servlet.jsp.jstl'
}
tasks.named('test') {
useJUnitPlatform()
}
โ๏ธ Spring Boot 3.0 ์ด์์์๋ JSTL/JSP ๊ด๋ จ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ javax โ jakarta๋ก ๋ณ๊ฒฝ๋์๊ธฐ ๋๋ฌธ์ ์์ฒ๋ผ jakarta.servlet ๊ธฐ๋ฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํด์ผ ์ ์ ์๋ํจ.
bootRun {
jvmArgs = ['-Xms512m', '-Xmx1024m', '-Dspring.profiles.active=dev']
}
# gradle.properties ๋๋ .gradle/gradle.properties์ ์์ฑ
org.gradle.jvmargs=-Xmx2048m -Xms1024m -Dfile.encoding=UTF-8
์ค์ ํญ๋ชฉ | ๊ฒฝ๋ก |
---|---|
Project SDK | File โ Project Structure โ Project |
Module SDK | File โ Project Structure โ Modules โ Dependencies |
Gradle JDK | File โ Settings โ Build Tools โ Gradle |
Run ์ค์ JVM ์ต์ | Run โ Edit Configurations โ VM Options ์ ๋ ฅ |
ํญ๋ชฉ | ์ค๋ช |
---|---|
๋น๋ ๋๊ตฌ | Gradle (Groovy DSL) |
JDK | Java 21 (Toolchain ์ฌ์ฉ) |
ํจํค์ง | WAR |
JSP/JSTL | Jakarta EE ๊ธฐ๋ฐ ์ค์ ํฌํจ |
ํ ์คํธ | JUnit Platform ์ฌ์ฉ |
๊ฐ๋ฐ ๋๊ตฌ | IntelliJ IDEA + Gradle + Spring Boot |
์ด๋ฒ ์ค์ ๊ณผ์ ์ ํตํด Spring Boot + Gradle ํ๊ฒฝ์ ์ ์ฒด์ ์ผ๋ก ๊ตฌ์กฐํํ๊ณ , IntelliJ์ UI ๊ธฐ๋ฅ์ ์ ๊ทน ํ์ฉํ๋ ๋ฐฉ๋ฒ๊น์ง ์ดํดํ ์ ์์๋ค. DSL ๋ฌธ๋ฒ ์ธ์๋ GUI ์ค์ ์ ๋ณํํ๋ฉด์ ์ง๊ด์ ์ธ ๊ฐ๋ฐํ๊ฒฝ ์ธํ ์ด ๊ฐ๋ฅํจ์ ๋๊ผ๋ค.
Project Structure
, Settings
, Run Config
์ธ ๊ฐ์ง๋ก ์ ๋ฆฌ ๊ฐ๋ฅ