diff --git a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/DependencyResolverImpl.groovy b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/DependencyResolverImpl.groovy index 7973570a5b89..2391b87cc037 100644 --- a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/DependencyResolverImpl.groovy +++ b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/DependencyResolverImpl.groovy @@ -128,15 +128,16 @@ class DependencyResolverImpl implements DependencyResolver { componentResults.each { componentResultsMap.put(it.id, it) } ResolutionResult resolutionResult = configuration.incoming.resolutionResult - def fileDeps = new LinkedHashSet(configuration.incoming.files.files); - artifactMap - artifactMap.values().each { - fileDeps.remove(it.file) - } - fileDeps.each { - def fileCollectionDependency = new DefaultFileCollectionDependency([it]) - fileCollectionDependency.scope = scope - result.add(fileCollectionDependency) + if(!configuration.resolvedConfiguration.hasError()) { + def fileDeps = new LinkedHashSet(configuration.incoming.files.files); + artifactMap.values().each { + fileDeps.remove(it.file) + } + fileDeps.each { + def fileCollectionDependency = new DefaultFileCollectionDependency([it]) + fileCollectionDependency.scope = scope + result.add(fileCollectionDependency) + } } result.addAll(transform(Lists.newArrayList(), resolutionResult.root.dependencies, artifactMap, componentResultsMap, scope)) }