Corrupt Ivy XML missing dependencies

201 views Asked by At

Running into a recurring issue - with the following stack: Nexus Ivy SBT

The library spray-can_2.11 will occasionally download with its dependency information missing in the ivy-1.3.2.xml file. The result is a successful build & dependency tree but runtime NoClassDefFound Exceptions. Here is an example of the corruption:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="io.spray"
        module="spray-can_2.11"
        revision="1.3.2"
        status="release"
        publication="20141008085147"
    >
        <license name="Apache 2" url="http://www.apache.org/licenses/LICENSE-2.0.txt" />
        <description homepage="http://spray.io">
        A suite of lightweight Scala libraries for building and consuming RESTful web services on top of Akka
        </description>
    </info>
    <configurations>
        <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
        <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
        <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
        <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
        <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
        <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
        <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
        <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
        <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
        <conf name="optional" visibility="public" description="contains all optional dependencies"/>
    </configurations>
    <publications>
        <artifact name="spray-can_2.11" type="bundle" ext="jar" conf="master"/>
        <artifact name="spray-can_2.11" type="source" ext="jar" conf="sources" m:classifier="sources"/>
        <artifact name="spray-can_2.11" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/>
    </publications>
    <dependencies>
    </dependencies>
</ivy-module>

Here is the file after the cache is wiped & downloaded again:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
    <info organisation="io.spray"
        module="spray-can_2.11"
        revision="1.3.2"
        status="release"
        publication="20141008085147"
    >
        <license name="Apache 2" url="http://www.apache.org/licenses/LICENSE-2.0.txt" />
        <description homepage="http://spray.io">
        A suite of lightweight Scala libraries for building and consuming RESTful web services on top of Akka
        </description>
    </info>
    <configurations>
        <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
        <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
        <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
        <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
        <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
        <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
        <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
        <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
        <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
        <conf name="optional" visibility="public" description="contains all optional dependencies"/>
    </configurations>
    <publications>
        <artifact name="spray-can_2.11" type="bundle" ext="jar" conf="master"/>
        <artifact name="spray-can_2.11" type="source" ext="jar" conf="sources" m:classifier="sources"/>
        <artifact name="spray-can_2.11" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/>
    </publications>
    <dependencies>
        <dependency org="org.scala-lang" name="scala-library" rev="2.11.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="io.spray" name="spray-io_2.11" rev="1.3.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="io.spray" name="spray-http_2.11" rev="1.3.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="io.spray" name="spray-util_2.11" rev="1.3.2" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        <dependency org="com.typesafe.akka" name="akka-osgi_2.11" rev="2.3.6" force="true" conf="provided->compile(*),provided(*),runtime(*),master(*)"/>
        <dependency org="com.typesafe.akka" name="akka-testkit_2.11" rev="2.3.6" force="true" conf="test->runtime(*),master(*)"/>
        <dependency org="org.specs2" name="specs2_2.11" rev="2.3.13" force="true" conf="test->runtime(*),master(*)"/>
    </dependencies>
</ivy-module>

Has anyone observed this issue and been able to identify a cause?

0

There are 0 answers