is it possible to force java module dependencies to use specify version

Viewed 24

I have a project that contains 40+ modules, I already know how to force using specify verison in the root build.gradle like this:

configurations.all {
        resolutionStrategy {
            eachDependency { DependencyResolveDetails details ->
                if (details.requested.group == 'com.github.jsqlparser') {
                    details.useVersion "2.1"
                }
                if (details.requested.group == 'org.postgresql' && details.requested.name == 'postgresql' ) {
                    details.useVersion("42.2.23")
                }
            }
        }
    }

But it changed all module dependencies version. is it possible just make some modules dependencies using specify version, this is my project module config:

project(":dolphin-manage") {
    dependencies {
    }
}

project(":dolphin-manage:dolphin-manage-api") {
    jar {
        enabled = true
    }

    bootJar {
        enabled = false
    }

    dependencies {
        api project(":dolphin-common-biz")
        api "com.rometools:rome:1.15.0"
    }
}

project(":dolphin-manage:dolphin-manage-service") {
    archivesBaseName = "dolphin-manage-service"
    version = "1.0.0-SNAPSHOT"

    bootJar {
        manifest {
            attributes 'Start-Class': 'com.dolphin.soa.manage.AppStarter'
        }
    }

    dependencies {
        implementation project(":dolphin-manage:dolphin-manage-api")
        implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery"
        implementation group: 'org.testng', name: 'testng', version: '7.4.0'
    }
    
}
0 Answers
Related