-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (73 loc) · 2.74 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import groovy.json.JsonSlurper
plugins {
id 'java'
id 'org.springframework.boot' version '3.0.4'
id 'io.spring.dependency-management' version '1.1.0'
id 'application'
}
group = 'com.weatherwhere'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
def env = new JsonSlurper().parse(new File('env.json'))
// env 변수를 사용하여 데이터베이스 연결 정보를 가져올 수 있습니다.
def DB_URL = env.DB_URL
def DB_USERNAME = env.DB_USERNAME
def DB_PASSWORD = env.DB_PASSWORD
def DB_NAME = env.DB_NAME
def AIR_FORECAST_SERVICE_KEY_DE=env.AIR_FORECAST_SERVICE_KEY_DE;
def KAKAO_REST_API_KEY=env.KAKAO_REST_API_KEY;
def STATION_SERVICE_KE_DE=env.STATION_SERVICE_KE_DE;
// application plugin에서 사용하는 설정
run {
// database.name 프로퍼티를 ${DB_NAME}의 값으로 설정
systemProperty 'DB_NAME', DB_NAME
systemProperty 'DB_URL', DB_URL
systemProperty 'DB_USERNAME', DB_USERNAME
systemProperty 'DB_PASSWORD', DB_PASSWORD
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-cache'
//Spring Batch
implementation 'org.springframework.boot:spring-boot-starter-batch'
// json 파싱
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
// json에서 환경변수 읽어오기 위해
implementation 'org.codehaus.groovy:groovy-json:2.5.14'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:3.0.4'
// jpa
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:3.0.4'
// DB, postgresql
implementation 'org.postgresql:postgresql:42.5.4'
runtimeOnly 'org.postgresql:postgresql'
//lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// log
implementation 'org.springframework.boot:spring-boot-starter-log4j2'
// redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis:3.0.4'
}
tasks.named('test') {
useJUnitPlatform()
// database.name 프로퍼티를 ${DB_NAME}의 값으로 설정
systemProperty 'DB_NAME', DB_NAME
systemProperty 'DB_URL', DB_URL
systemProperty 'DB_USERNAME', DB_USERNAME
systemProperty 'DB_PASSWORD', DB_PASSWORD
systemProperty "AIR_FORECAST_SERVICE_KEY_DE", AIR_FORECAST_SERVICE_KEY_DE
systemProperty "KAKAO_REST_API_KEY", KAKAO_REST_API_KEY
systemProperty "STATION_SERVICE_KE_DE", STATION_SERVICE_KE_DE
}
configurations{
all{
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
}