build.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.3'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'com.yurapp'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
// Spring Boot 기본 웹 애플리케이션 (Spring MVC 포함)
implementation 'org.springframework.boot:spring-boot-starter-web'
// MyBatis & Spring Boot 통합
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.4'
// Lombok (코드 자동 생성, annotation processor 필요)
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// Spring Boot 개발 도구 (핫 리로드 기능 지원)
developmentOnly 'org.springframework.boot:spring-boot-devtools'
// PostgreSQL JDBC 드라이버
runtimeOnly 'org.postgresql:postgresql'
// Spring Boot 데이터 유효성 검사 (@Valid, @RequestBody 등)
implementation 'org.springframework.boot:spring-boot-starter-validation'
// Thymeleaf 템플릿 엔진 (HTML 렌더링)
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
// Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.security:spring-security-web'
// JWT 관련 라이브러리
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'
// JSON 직렬화 및 파싱 (Gson)
implementation 'com.google.code.gson:gson:2.8.9'
// UUID 생성 라이브러리
implementation "com.fasterxml.uuid:java-uuid-generator:4.0.1"
// 테스트 의존성
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:3.0.4'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.springframework.security:spring-security-test'
// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
}
tasks.named('test') {
useJUnitPlatform()
}
// Java 컴파일 시 매개변수 이름 유지 설정 (-parameters 옵션 적용)
// ✔️ @Valid, @RequestBody, @PathVariable 사용 시 변수명 유지
// ✔️ Swagger API 문서 자동 생성 시 변수명 유지
// ✔️ Spring Security JWT 인증 API에서 DTO 필드명 유지
compileJava {
options.compilerArgs << '-parameters'
}
배포환경에서는 비활성화하거나
developmentOnly 로 해줘야함
반응형
'웹 개발 > 🍃 SpringBoot' 카테고리의 다른 글
Spring Boot | 패키지 구조(계층형 vs 도메인형) (1) | 2025.05.29 |
---|---|
findAll()에서 Optional<List<T>>를 쓰지 않아도 되는 이유 (1) | 2025.05.20 |
SpringSecurity + JWT 에서 nginx health-check 요구시 문제 (0) | 2025.04.01 |
Springboot | 생성자관련 어노테이션 (0) | 2025.03.13 |
SpringBoot + MyBatis + Postgres 완전정복 (0) | 2025.03.11 |