plugins {
id 'java'
id 'org.springframework.boot' version '3.4.11'
id 'io.spring.dependency-management' version '1.1.7'
id 'jacoco'
}
group = 'com.codeit'
version = '0.0.1-SNAPSHOT'
description = 'playlist'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework.batch:spring-batch-test'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'com.nimbusds:nimbus-jose-jwt:10.3'
// MapStruct
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'
annotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
// Redis (Watching Session)
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// AWS SDK
implementation(platform("software.amazon.awssdk:bom:2.27.21"))
implementation "software.amazon.awssdk:s3"
implementation "software.amazon.awssdk:auth"
//QueryDSL
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
implementation 'com.querydsl:querydsl-core:5.0.0'
annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jakarta'
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
// 비밀번호 재설정에서 Rate Limiting 을 적용시키기 위한 의존성
implementation 'com.bucket4j:bucket4j-core:8.2.0'
implementation 'com.bucket4j:bucket4j-redis:8.10.1'
implementation 'org.redisson:redisson:3.50.0'
//이메일로 임시 비밀번호 전송을 위한 의존성
implementation 'org.springframework.boot:spring-boot-starter-mail'
// AWS S3
implementation 'software.amazon.awssdk:s3:2.25.64'
// test용 h2
testImplementation 'com.h2database:h2'
// Kafka
implementation 'org.springframework.kafka:spring-kafka'
// OAuth 2
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}
jacoco {
toolVersion = "0.8.12"
}
jacocoTestReport {
dependsOn test
reports {
xml.required.set(true)
html.required.set(true)
}
// 제외할 패턴들을 한 곳에서 관리
def excludePatterns = [
// QueryDSL Q 클래스 (QA ~ QZ)
"**/Q*/**",
// 우리가 커버리지에서 제외하고 싶은 패키지
"**/mapper/**",
"**/entity/**",
"**/dto/**",
"**/exception/**",
"**/error/**",
"**/repository/**",
"**/security/**",
"**/global/**"
]
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, exclude: excludePatterns)
})
)
}
}
tasks.check {
dependsOn tasks.jacocoTestCoverageVerification
}
// 모든 의존성에서 slf4j-simple을 제외
configurations.all {
exclude group: 'org.slf4j', module: 'slf4j-simple'
}