From 5f7a6a192ac412bbdceaeaa16b3f62438ab00fe4 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sun, 29 May 2011 19:17:31 -0400 Subject: [PATCH] drop custom conflict manager to fix IvyNode-related exception --- ivy/Ivy.scala | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/ivy/Ivy.scala b/ivy/Ivy.scala index 7bc2d33fc..e5ab87aa9 100644 --- a/ivy/Ivy.scala +++ b/ivy/Ivy.scala @@ -18,7 +18,7 @@ import core.module.descriptor.{DefaultDependencyDescriptor, DefaultModuleDescrip import core.module.id.{ArtifactId,ModuleId, ModuleRevisionId} import core.resolve.IvyNode import core.settings.IvySettings -import plugins.conflict.{ConflictManager, LatestConflictManager} +import plugins.conflict.{ConflictManager, LatestCompatibleConflictManager, LatestConflictManager} import plugins.latest.LatestRevisionStrategy import plugins.matcher.PatternMatcher import plugins.parser.m2.PomModuleDescriptorParser @@ -60,7 +60,6 @@ final class IvySbt(val configuration: IvyConfiguration) { val is = new IvySettings is.setBaseDir(baseDirectory) - is.setDefaultConflictManager(IvySbt.latestNoForce(is)) configuration match { case e: ExternalIvyConfiguration => is.load(e.file) @@ -441,36 +440,4 @@ private object IvySbt case Some(confs) => confs.map(_.name).toList.toArray case None => module.getPublicConfigurationsNames } - - // same as Ivy's builtin latest-revision manager except that it ignores the force setting, - // which seems to be added to dependencies read from poms (perhaps only in certain circumstances) - // causing revisions of indirect dependencies other than latest to be selected - def latestNoForce(settings: IvySettings): ConflictManager = - { - import collection.JavaConversions._ - - new LatestConflictManager("latest-revision-no-force", new LatestRevisionStrategy) - { - setSettings(settings) - - override def resolveConflicts(parent: IvyNode, conflicts: Collection[_]): Collection[_] = - if(conflicts.size < 2) - conflicts - else - resolveMultiple(parent, conflicts.asInstanceOf[Collection[IvyNode]]).asInstanceOf[Collection[_]] - - def resolveMultiple(parent: IvyNode, conflicts: Collection[IvyNode]): Collection[IvyNode] = - { - val matcher = settings.getVersionMatcher - val dynamic = conflicts.exists { node => matcher.isDynamic(node.getResolvedId) } - if(dynamic) null else { - try { - val l = getStrategy.findLatest(toArtifactInfo(conflicts), null).asInstanceOf[{def getNode(): IvyNode}] - if(l eq null) conflicts else singleton(l.getNode) - } - catch { case e: LatestConflictManager.NoConflictResolvedYetException => null } - } - } - } - } }