@@ -3,6 +3,7 @@ plugins {
33 id ' application' // application 플러그인 추가
44 id ' org.springframework.boot' version ' 3.3.6'
55 id ' io.spring.dependency-management' version ' 1.1.7'
6+ id ' com.gorylenko.gradle-git-properties' version ' 2.4.1' // git 정보 읽기
67}
78
89group = ' com.sprint.mission'
@@ -39,6 +40,12 @@ dependencies {
3940 // Spring Boot Web 의존성 (Spring MVC, REST 등)
4041 implementation ' org.springframework.boot:spring-boot-starter-web'
4142
43+ // Spring Validation 의존성
44+ implementation ' org.springframework.boot:spring-boot-starter-validation'
45+
46+ // Spring Actuator 의존성
47+ implementation ' org.springframework.boot:spring-boot-starter-actuator'
48+
4249 // Lombok 의존성 (간결한 코드 작성)
4350 compileOnly ' org.projectlombok:lombok' // 컴파일 타임에만 Lombok을 사용
4451 annotationProcessor ' org.projectlombok:lombok' // Lombok 애노테이션 프로세서
@@ -63,6 +70,23 @@ dependencies {
6370}
6471
6572
73+ gitProperties {
74+ dateFormat = " yyyy-MM-dd'T'HH:mm:ssZ"
75+ dateFormatTimeZone = " UTC"
76+ }
77+
78+ tasks. register(' writeBuildProperties' ) {
79+ doLast {
80+ def props = new Properties ()
81+ props. setProperty(' version' , project. version. toString())
82+ props. setProperty(' time' , new Date (). format(" yyyy-MM-dd'T' HH:mm:ss'Z'" , Timezone . getTimeZone(" UTC" )))
83+
84+ def file = file(" $buildDir /resources/main/build.properties" )
85+ file. parentFile. mkdir()
86+ props. store(file. newWriter(), null )
87+ }
88+ }
89+
6690tasks. named(' test' ) {
6791 useJUnitPlatform()
6892}
0 commit comments