diff --git a/launch/LaunchConfiguration.scala b/launch/LaunchConfiguration.scala index 3b04d0c19..f17a02965 100644 --- a/launch/LaunchConfiguration.scala +++ b/launch/LaunchConfiguration.scala @@ -70,6 +70,7 @@ object Repository def apply(s: String): Predefined = Predefined(toValue(s)) } + def isMavenLocal(repo: Repository) = repo == Predefined(Predefined.MavenLocal) def defaults: List[Repository] = Predefined.elements.map(Predefined.apply).toList } diff --git a/launch/Update.scala b/launch/Update.scala index f314e9070..5e1be2b36 100644 --- a/launch/Update.scala +++ b/launch/Update.scala @@ -154,6 +154,7 @@ final class Update(config: UpdateConfiguration) val resolveOptions = new ResolveOptions // this reduces the substantial logging done by Ivy, including the progress dots when downloading artifacts resolveOptions.setLog(LogOptions.LOG_DOWNLOAD_ONLY) + resolveOptions.setCheckIfChanged(false) val resolveEngine = new ResolveEngine(settings, eventManager, new SortEngine(settings)) val resolveReport = resolveEngine.resolve(module, resolveOptions) if(resolveReport.hasError) @@ -194,16 +195,23 @@ final class Update(config: UpdateConfiguration) val newDefault = new ChainResolver newDefault.setName("redefined-public") if(repositories.isEmpty) error("No repositories defined.") - repositories.foreach(repo => newDefault.add(toIvyRepository(settings, repo))) + for(repo <- repositories if includeRepo(repo)) + newDefault.add(toIvyRepository(settings, repo)) onDefaultRepositoryCacheManager(settings)(configureCache) settings.addResolver(newDefault) settings.setDefaultResolver(newDefault.getName) } + // exclude the local Maven repository for Scala -SNAPSHOTs + private def includeRepo(repo: Repository) = !(Repository.isMavenLocal(repo) && isSnapshot(scalaVersion) ) + private def isSnapshot(scalaVersion: String) = scalaVersion.endsWith(Snapshot) + private[this] val Snapshot = "-SNAPSHOT" + private[this] val ChangingPattern = ".*" + Snapshot + private[this] val ChangingMatcher = PatternMatcher.REGEXP private def configureCache(manager: DefaultRepositoryCacheManager) { manager.setUseOrigin(true) - manager.setChangingMatcher(PatternMatcher.REGEXP) - manager.setChangingPattern(".*-SNAPSHOT") + manager.setChangingMatcher(ChangingMatcher) + manager.setChangingPattern(ChangingPattern) } private def toIvyRepository(settings: IvySettings, repo: Repository) = {