The pom.xml
from the Clojars Repository contains following entries:
<properties>
<scalaVersion>2.9.2</scalaVersion>
<kafkaArtifact>kafka_2.9.2</kafkaArtifact>
<envClassifier/>
</properties>
during resolving Ivy will use following pattern for computing download URL
[organisation]/[module](_[scalaVersion])(_[sbtVersion])/[revision]/[artifact]-[revision](-[classifier]).[ext]
and it will substitute [scalaVersion]
with the values read from the pom.xml
. Hence the invalid URL and the error.
Edit
As I've promised promised the detailed description what happens:
Ivy will download POM of the library.
Somewhere in the process of downloading dependencies, Ivy will call MyModuleDescriptorProvider#provideModule. The function will return ModuleDescriptor
obtained by parsing already downloaded POM file.
To do that Ivy calls CustomPomParser#parseDescriptor. After some series of calls we arrive at CustomPomParser#defaultTransformImpl, which first line is val properties = getPomProperties(md)
.
The resulting properties
contain the Scala version property defined in the POM file. The properties are stored in the ModuleDescriptor
as an extra module attributes.
Later when the download URL is built, the pattern I have mentioned previously is used. The place holders, are substituted in a method IvyPatternHelper.subsitute. Arguments to the method contain the parsed attributes and the substitution leads to the faulty URL.