Skip to content

Instantly share code, notes, and snippets.

@rwinch
Created December 11, 2013 14:39
Show Gist options
  • Save rwinch/7911475 to your computer and use it in GitHub Desktop.
Save rwinch/7911475 to your computer and use it in GitHub Desktop.
Gradle DependencyResolveDetails example
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
compile 'org.springframework:spring-core', // spring-core has no version specified
// security brings in spring version 3.0.7
'org.springframework.security:spring-security-core:3.1.4.RELEASE'
}
// ensure that all versions of spring are using 3.2.5.RELEASE
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.springframework')
details.useVersion '3.2.5.RELEASE'
}
}
// invoke "gradle dependencies" to see listing of dependencies
@BinyangChen
Copy link

configurations.all {
    resolutionStrategy {
        if (!Boolean.getBoolean("skipVersionConflict")) {
            failOnVersionConflict()
        }
        preferProjectModules()
        cacheDynamicVersionsFor 5, 'days'
        cacheChangingModulesFor 5, 'days'

        /**
         * Required for all JRadius modules
         */
        eachDependency { DependencyResolveDetails details ->
            if (details.requested.group == "gnu-getopt") {
                details.useTarget group: "gnu.getopt", name: "java-getopt", version: details.requested.version
            }
        }
    }

    exclude(group: "ch.qos.logback", module: "logback-core")
    exclude(group: "ch.qos.logback", module: "logback-classic")
    exclude(group: "cglib", module: "cglib")
    exclude(group: "cglib", module: "cglib-full")
}

Cannot resolve symbol 'DependencyResolveDetails'

@Manishsindhal
Copy link

I was also face this issue but now resolved,
Download ndk bundle from File -> Project Structure -> and download ndk that's it.

Enjoy the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment