Repository: incubator-groovy
Updated Branches:
  refs/heads/master 7048e31fe -> ddb6ea071


GROOVY-7649: Grape.resolve() always fails after first unresolved dependency 
(closes #164)

clean up current dependencies state when resolve fails


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/292be3ca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/292be3ca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/292be3ca

Branch: refs/heads/master
Commit: 292be3cadb3e2128565363c7fff21b9321ef6222
Parents: 7048e31
Author: Jason Plurad <plur...@apache.org>
Authored: Wed Oct 28 06:17:22 2015 -0700
Committer: pascalschumacher <pascalschumac...@gmx.net>
Committed: Wed Oct 28 19:49:45 2015 +0100

----------------------------------------------------------------------
 src/main/groovy/grape/GrapeIvy.groovy | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/292be3ca/src/main/groovy/grape/GrapeIvy.groovy
----------------------------------------------------------------------
diff --git a/src/main/groovy/grape/GrapeIvy.groovy 
b/src/main/groovy/grape/GrapeIvy.groovy
index 0aaab39..3bdabe8 100644
--- a/src/main/groovy/grape/GrapeIvy.groovy
+++ b/src/main/groovy/grape/GrapeIvy.groovy
@@ -565,7 +565,15 @@ class GrapeIvy implements GrapeEngine {
         // err on the side of using the class already loaded into the
         // classloader rather than adding another jar of the same module
         // with a different version
-        ResolveReport report = getDependencies(args, 
*localDeps.asList().reverse())
+        ResolveReport report = null
+        try {
+            report = getDependencies(args, *localDeps.asList().reverse())
+        } catch (Exception e) {
+            // clean-up the state first
+            localDeps.removeAll(grabRecordsForCurrDependencies)
+            grabRecordsForCurrDependencies.clear()
+            throw e
+        }
 
         List<URI> results = []
         for (ArtifactDownloadReport adl in report.allArtifactsReports) {

Reply via email to