harrah/xsbt — Issue #368: Resolving sbt-plugins from cache is slow
Author: jrudolph
Created: 2012-02-14 15:22:22+00:00
State: open

At least everytime something in your global sbt plugin configuration changes all projects have to re-resolve the plugin dependencies. This is particularly slow because ivy produces broken ivy.xml files in the cache for sbt plugins leading to warnings like this:

[debug] No entry is found in the ModuleDescriptorCache : /home/johannes/.ivy2/cache/scala_2.9.1/sbt_0.11.2/net.databinder/posterous-sbt/ivy-0.3.2.xml
[debug] post 1.3 ivy file: using exact as default matcher
[debug]	problem while parsing cached ivy file for: net.databinder#posterous-sbt;0.3.2: [xml parsing: ivy-0.3.2.xml:9:3: cvc-complex-type.3.2.2: Attribute 'sbtVersion' is not allowed to appear in element 'info'. in file:/home/johannes/.ivy2/cache/scala_2.9.1/sbt_0.11.2/net.databinder/posterous-sbt/ivy-0.3.2.xml
[debug] , xml parsing: ivy-0.3.2.xml:9:3: cvc-complex-type.3.2.2: Attribute 'scalaVersion' is not allowed to appear in element 'info'. in file:/home/johannes/.ivy2/cache/scala_2.9.1/sbt_0.11.2/net.databinder/posterous-sbt/ivy-0.3.2.xml

In consequence that means that at least the metadata has to be re-downloaded from the repositories which is slow.

If you look into those cached ivy files it seems that ivy generates additional non-namespace-qualifed attributes in the ```` tag for the ``scalaVersion`` and ``sbtVersion`` classifiers coming from poms.

Here's a possibly related bug in Ivy's bugtracker: https://issues.apache.org/jira/browse/IVY-1322

A workaround could be to switch off ``ivy.xml`` validation for the cache resolver as long as the problem is not properly fixed on the ivy side.