본문 바로가기

Monew

build.gradle

이번 프로젝트에서 사용된 의존성

 

plugins {
    id 'java'
    id 'org.springframework.boot' version '3.4.9'
    id 'io.spring.dependency-management' version '1.1.7'
    id 'jacoco' // jacoco 추가
}

group = 'com.codeit'
version = '0.0.1-SNAPSHOT'
description = 'MoNew'

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-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    implementation 'org.springframework.boot:spring-boot-starter-web'

    compileOnly 'org.projectlombok:lombok'
    runtimeOnly 'com.h2database:h2'
    runtimeOnly 'org.postgresql:postgresql'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

    implementation 'at.favre.lib:bcrypt:0.10.2' // 비밀번호 암호화
    implementation 'org.mapstruct:mapstruct:1.5.5.Final' // 맵 스트럭트
    annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final' // 맵 스트럭트
    implementation 'software.amazon.awssdk:s3:2.31.7' // S3

    implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
    annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta"
    annotationProcessor "jakarta.annotation:jakarta.annotation-api"
    annotationProcessor "jakarta.persistence:jakarta.persistence-api"

    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    implementation 'com.fasterxml.jackson.core:jackson-databind' // JSON 파싱
    implementation "me.paulschwarz:spring-dotenv:3.0.0"

    testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
    testImplementation 'org.assertj:assertj-core:3.25.3'
    testImplementation 'org.mockito:mockito-core:5.12.0'
    testImplementation 'com.squareup.okhttp3:mockwebserver:4.12.0'

    testImplementation 'org.assertj:assertj-core:3.26.3' // assertj

    //spring batch
    implementation 'org.springframework.boot:spring-boot-starter-batch'
    implementation 'org.springframework.boot:spring-boot-starter-quartz'
    implementation 'io.micrometer:micrometer-core'
    testImplementation 'org.springframework.batch:spring-batch-test'

    testRuntimeOnly 'com.h2database:h2:2.2.224'

    implementation 'org.jsoup:jsoup:1.17.2'   // 기사 크롤링


    implementation 'software.amazon.awssdk:s3:2.31.7' // 아마존 S3 버킷 백업/복구

    implementation 'com.fasterxml.jackson.core:jackson-databind' // Jackson
    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' // Jackson
}

tasks.named('test') {
    useJUnitPlatform()
    finalizedBy jacocoTestReport, jacocoTestCoverageVerification // jacoco Test 추가
}

// jacoco 추가
jacoco {
    toolVersion = "0.8.12"
}

// jacocoTestReport 추가
jacocoTestReport {
    dependsOn test
    reports {
        xml.required = true // CI에서 파싱하기 위함
        html.required = true // 보기 편하게 추가
    }
}

// jacocoTestCoverageVerification 추가
jacocoTestCoverageVerification {
    violationRules {
        rule {
            limit {
                counter = 'LINE'
                value = 'COVEREDRATIO'
//                minimum = 0.80 // 80% 미만이면 실패함
            }
        }
    }
}