-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
80 lines (65 loc) · 1.76 KB
/
build.gradle
File metadata and controls
80 lines (65 loc) · 1.76 KB
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
// 플러그인 설정
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.5'
id 'io.spring.dependency-management' version '1.1.7'
}
// 프로젝트 정보
group = 'umc'
version = '0.0.1-SNAPSHOT'
// 자바 설정
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
// 저장소 설정
repositories {
mavenCentral()
}
// 의존성 구성 설정
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
// !!! 생성된 Q-Type 소스 디렉토리 정의 변경 !!!
def generatedDir = file('src/main/generated')
// 의존성 설정
dependencies {
// Spring Boot 기본 의존성
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// MySQL 드라이버
runtimeOnly 'mysql:mysql-connector-java:8.0.33'
// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// Querydsl JPA 및 APT
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api:3.1.0'
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
// 테스트 의존성
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
sourceSets {
main {
java {
srcDirs += [generatedDir]
}
}
}
tasks.withType(JavaCompile) {
// Annotation Processor가 생성하는 소스 경로 설정
options.getGeneratedSourceOutputDirectory().set(generatedDir)
// 컴파일러에 -parameters 인자 추가
options.compilerArgs += '-parameters'
}
tasks.named('clean') {
delete generatedDir
}
tasks.named('test') {
useJUnitPlatform()
}