Gradle Dependency Management Best Practice

Hello Gradle experts,

We have just started to explore gradle and plan to move out of ant. We use sonatype nexus to store public artifacts.

I am trying to figure out the gradle best practice in locking down the version of thirdparty artifacts that’s downloaded during the project build from nexus. Consider, there was a recent update to a public artifact say, com.abc:cde:3.4.2

During the build execution, gradle pulls the latest version of the artifact from nexus even though the gradle file is explicitly set to download com.abc:cde:3.4.1

I am currently using resolutionStrategy method of gradle to force a particular version. We have 100’s of different artifacts that also needs similar treatment. I could specify compile ‘com.abc:xyz:1.2’ {force = true} for all the 100 different dependencies. But i would like to get some insights if thats the best way to handle such a situation

  1. Is there a global parameter to force only the version of artifacts mentioned in gradle file and not download the latest from nexus.

  2. If not, what is the recommended best practice? This is mainly causing developers a nightmare and unexpected failures in our build process.

       repositories {
        maven {
          url "https://nexus.xxx.com/nexus/content/groups/public/"
           }
       }
    

    configurations {
    compile
    }
    configurations.all {
    resolutionStrategy {
    force ‘com.abc:cde:3.4.2’
    }
    }
    dependencies {
    compile 'com.abc:xyz:1.2’
    compile ‘com.abc:def:1.7’
    }

Appreciate your inputs

The Gradle core does not handle this problem, but here are 2 plugins you may find useful:


Thanks for the pointer, I incorporated spring-gradle-plugin in the build.gradle file, however the build is failing due to the error in the stacktrace. Any clue is highly appreciated

buildscript { repositories { maven { url "https://nexus.xxx.com/nexus/content/repositories/jcenter/" } } dependencies { classpath "io.spring.gradle:dependency-management-plugin:0.5.5.RELEASE" } }

ERROR STACK TRACE:

18:57:54.761 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder] Attaching org.apache.httpcomponents:httpcore:4.3.3(runtime) to its parents. 18:57:54.771 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientResultsStore] Flushing resolved configuration data in Binary store in C:\Users\user\AppData\Local\Temp\gradle949042084896363518.bin. Wrote root :PROJECT:unspecified:detachedConfiguration3. 18:57:54.791 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.StreamingResolutionResultBuilder$RootFactory] Loaded resolution results (0.01 secs) from Binary store in C:\Users\user\AppData\Local\Temp\gradle2750878151306120006.bin (exist: true) 18:57:54.811 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@13a317a, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@186768e, org.gradle.logging.internal.JavaUtilLoggingConfigurer@d19bc8] 18:57:54.831 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':dependencies' 18:57:54.831 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :dependencies (Thread[main,5,main]) completed. Took 1 mins 11.133 secs. 18:57:54.841 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 1 mins 11.133 secs, idle: 0.02 secs 18:57:54.861 [ERROR] [org.gradle.BuildExceptionReporter] 18:57:54.861 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception. 18:57:54.871 [ERROR] [org.gradle.BuildExceptionReporter] 18:57:54.881 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong: 18:57:54.891 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':dependencies'. 18:57:54.901 [ERROR] [org.gradle.BuildExceptionReporter] > Failed to notify dependency resolution listener. 18:57:54.911 [ERROR] [org.gradle.BuildExceptionReporter] > org/gradle/api/artifacts/result/ResolvedComponentResult 18:57:54.921 [ERROR] [org.gradle.BuildExceptionReporter] 18:57:54.931 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is: 18:57:54.941 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':dependencies'. 18:57:54.941 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) 18:57:54.951 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) 18:57:54.961 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) 18:57:54.971 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) 18:57:54.981 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 18:57:54.991 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42) 18:57:55.001 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) 18:57:55.001 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) 18:57:55.011 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 18:57:55.021 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:283) 18:57:55.031 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79) 18:57:55.041 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63) 18:57:55.051 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51) 18:57:55.051 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$1.run(DefaultTaskPlanExecutor.java:33) 18:57:55.061 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Factories$1.create(Factories.java:22) 18:57:55.071 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:214) 18:57:55.081 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:276) 18:57:55.091 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142) 18:57:55.091 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:78) 18:57:55.101 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31) 18:57:55.111 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86) 18:57:55.121 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29) 18:57:55.131 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 18:57:55.141 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) 18:57:55.151 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) 18:57:55.161 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 18:57:55.161 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 18:57:55.171 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54) 18:57:55.181 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166) 18:57:55.191 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113) 18:57:55.201 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81) 18:57:55.211 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64) 18:57:55.221 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33) 18:57:55.231 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24) 18:57:55.231 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35) 18:57:55.241 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) 18:57:55.251 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50) 18:57:55.261 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171) 18:57:55.261 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201) 18:57:55.271 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174) 18:57:55.281 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170) 18:57:55.291 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139) 18:57:55.301 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 18:57:55.311 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) 18:57:55.321 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:46) 18:57:55.321 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 18:57:55.331 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:37) 18:57:55.341 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) 18:57:55.351 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32) 18:57:55.361 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:23) 18:57:55.361 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) 18:57:55.371 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) 18:57:55.381 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:58) 18:57:55.381 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.listener.ListenerNotificationException: Failed to notify dependency resolution listener. 18:57:55.391 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:90) 18:57:55.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:30) 18:57:55.401 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) 18:57:55.411 [ERROR] [org.gradle.BuildExceptionReporter] at $Proxy19.beforeResolve(Unknown Source) 18:57:55.421 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:239) 18:57:55.431 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$900(DefaultConfiguration.java:45) 18:57:55.431 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationResolvableDependencies.getResolutionResult(DefaultConfiguration.java:568) 18:57:55.441 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.diagnostics.internal.dependencies.AsciiDependencyReportRenderer.render(AsciiDependencyReportRenderer.java:82) 18:57:55.451 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.diagnostics.DependencyReportTask.generate(DependencyReportTask.java:58) 18:57:55.461 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.diagnostics.AbstractReportTask.generate(AbstractReportTask.java:67) 18:57:55.461 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.JavaMethod.invoke(JavaMethod.java:62) 18:57:55.471 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219) 18:57:55.481 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212) 18:57:55.491 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201) 18:57:55.501 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:527) 18:57:55.511 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:510) 18:57:55.511 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) 18:57:55.521 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) 18:57:55.531 [ERROR] [org.gradle.BuildExceptionReporter] ... 52 more 18:57:55.541 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoClassDefFoundError: org/gradle/api/artifacts/result/ResolvedComponentResult 18:57:55.541 [ERROR] [org.gradle.BuildExceptionReporter] at io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction.findExcludedDependencies(ExclusionConfiguringAction.groovy:99) 18:57:55.551 [ERROR] [org.gradle.BuildExceptionReporter] at io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction.applyMavenExclusions(ExclusionConfiguringAction.groovy:76) 18:57:55.561 [ERROR] [org.gradle.BuildExceptionReporter] at io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction.this$2$applyMavenExclusions(ExclusionConfiguringAction.groovy) 18:57:55.571 [ERROR] [org.gradle.BuildExceptionReporter] at io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction$this$2$applyMavenExclusions.callCurrent(Unknown Source) 18:57:55.581 [ERROR] [org.gradle.BuildExceptionReporter] at io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction.execute(ExclusionConfiguringAction.groovy:71) 18:57:55.591 [ERROR] [org.gradle.BuildExceptionReporter] at io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction.execute(ExclusionConfiguringAction.groovy) 18:57:55.591 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:105) 18:57:55.601 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:94) 18:57:55.611 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:81) 18:57:55.621 [ERROR] [org.gradle.BuildExceptionReporter] ... 69 more 18:57:55.631 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.ClassNotFoundException: org.gradle.api.artifacts.result.ResolvedComponentResult 18:57:55.631 [ERROR] [org.gradle.BuildExceptionReporter] ... 78 more 18:57:55.641 [ERROR] [org.gradle.BuildExceptionReporter] 18:57:55.651 [LIFECYCLE] [org.gradle.BuildResultLogger] 18:57:55.661 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED 18:57:55.671 [LIFECYCLE] [org.gradle.BuildResultLogger] 18:57:55.681 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 1 mins 59.463 secs 18:57:55.681 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache taskArtifacts.bin (C:\project\.gradle\1.8\taskArtifacts\taskArtifacts.bin) 18:57:55.691 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on task artifact state cache (C:\project\.gradle\1.8\taskArtifacts). 18:57:55.701 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on no_buildscript class cache for build file 'C:\project\build.gradle' (C:\Users\user\.gradle\caches\1.8\scripts\build_5tamba065l9q8vhu5o874pghnk\ProjectScript\no_buildscript). 18:57:55.711 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on buildscript class cache for build file 'C:\project\build.gradle' (C:\Users\user\.gradle\caches\1.8\scripts\build_5tamba065l9q8vhu5o874pghnk\ProjectScript\buildscript). 18:57:55.721 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache dynamic-revisions.bin (C:\Users\user\.gradle\caches\artifacts-26\dynamic-revisions.bin) 18:57:55.731 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache module-metadata.bin (C:\Users\user\.gradle\caches\artifacts-26\module-metadata.bin) 18:57:55.741 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache artifact-at-repository.bin (C:\Users\user\.gradle\caches\artifacts-26\artifact-at-repository.bin) 18:57:55.751 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on artifact cache (C:\Users\user\.gradle\caches\artifacts-26). 18:57:55.761 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryDependencyMetadataCache] In-memory dependency metadata cache closed. Repos cached: 2, cache instances: 2, modules served from cache: 0, artifacts: 0 18:57:55.771 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolved configuration cache closed. Cache reads: 0, disk reads: 1 (avg: 0.02 secs, total: 0.02 secs) 18:57:55.781 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs) 18:57:55.791 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 2 resolution results binary files in 0.02 secs 18:57:55.801 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@13a317a, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@186768e, org.gradle.logging.internal.JavaUtilLoggingConfigurer@d19bc8]

Which version of Gradle are you using?

If you post a sample failing build, there is a good chance that someone would help you more.

We are on Gradle 1.8.6. Below is the sample build file and the detailed stack trace is mentioned in the previous post.

`import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.tasks.Exec
apply plugin: “io.spring.dependency-management”

buildscript {
repositories {
maven {
url “https://nexus.xxxx.com/nexus/content/repositories/jcenter/
}
}
dependencies {
classpath “io.spring.gradle:dependency-management-plugin:0.5.5.RELEASE”
}
}

repositories {
maven {
url “https://nexus.xxxx.com/nexus/content/groups/public/
}
}

configurations {
compile
}

configurations.all {
resolutionStrategy {
force ‘org.testng:testng:6.8.17’
}
}

dependencyManagement {
dependencies {
compile 'org.apache.lucene:lucene-core:4.7.2’
compile 'org.apache.lucene:lucene-analyzers-common:4.7.2’
compile ('org.apache.lucene:lucene-queryparser:4.7.2) { transitive = false}
}
}
`

Version 1.8.6 is from 2013 - Gradle has changed a lot since then and I wouldn’t expect any 3rd-party plugins to work with anything less than 2.0

You may check the manual for your version whether it supports dependency resolution strategy, though the time to implement your use case could be better spent trying to upgrade Gradle for your builds and use one of the existing solutions (as a bonus, you don’t have to maintain it).

Thanks, switching to 2.1 gradle version helped getting rid of the errors. I am able to use the spring dependency handler with ease now… Thanks again