듀플8

발행: (2026년 2월 6일 오전 05:06 GMT+9)
1 분 소요
원문: Dev.to

Source: Dev.to

JAR에서 MessageTypeConstant를 제거하는 Gradle 스크립트

// 1. Define where the "clean" JAR will live
def strippedLibDir = file("$buildDir/stripped-libs")

// 2. Task to perform the "surgery" on the JAR
task stripMessageTypeConstant(type: Copy) {
    doFirst {
        // Create a detached configuration to avoid locking the main build
        def detached = configurations.detachedConfiguration(
            dependencies.create("com.citigroup:EQRioINtf:1.3_D5")
        )
        def oldJarFile = detached.resolve().find { it.name.contains("EQRioINtf") }

        if (oldJarFile) {
            from zipTree(oldJarFile)
            into strippedLibDir
            // EXCLUDE: Physically remove the conflicting constant class
            exclude "com/citigroup/get/zcc/intf/MessageTypeConstant.class"
        }
    }
}

// 3. Update dependencies to use the result
dependencies {
    // Force OESIntf to be the source of truth for the constants
    implementation 'com.citigroup:OESIntf3_8:3.8_A29-SNAPSHOT'

    // Use the stripped directory as a dependency
    // This provides all other classes from EQRioINtf except the constant
    implementation files(strippedLibDir) {
        builtBy stripMessageTypeConstant
    }
}
Back to Blog

관련 글

더 보기 »

switch 문

개요 - switch case는 변수 또는 표현식의 값에 따라 서로 다른 코드 블록을 실행할 수 있게 해주는 제어문입니다. - 이것은 종종 cleane...