dupl8

发布: (2026年2月6日 GMT+8 04:06)
1 分钟阅读
原文: Dev.to

Source: Dev.to

Gradle 脚本:从 JAR 中剥离 MessageTypeConstant

// 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
    }
}
0 浏览
Back to Blog

相关文章

阅读更多 »

软件开发充满了隐形的选择。

不是那些头条新闻——框架之争、炫酷的 UI 趋势、“10 倍”神话。我指的是那些要到几个月后才会显现的决策:你如何处理更新、如何存储……

Java中的模块

markdown !Cover Imagehttps://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazo...

模拟面试-2

面试问题 1. 请介绍一下你自己? 2. 为什么从 Mechanical Engineering 转向 IT? 3. 如果 Mechanical Engineering 是你的首选,为什么选择……