Emma Strubell
Emma Strubell

Reputation: 655

sbt not resolving dependency; path correct except ${package.type} extension

sbt (0.13.8) is failing to resolve the dependency in the following extremely simple build.sbt:

organization := "edu.umass.cs.iesl"

name := "nn-depparse"

version := "0.1-SNAPSHOT"

scalaVersion := "2.11.7"

resolvers += "IESL snapshot repository" at "https://dev-iesl.cs.umass.edu/nexus/content/repositories/snapshots/"

libraryDependencies += "cc.factorie" %% "factorie" % "1.2-SNAPSHOT"

parallelExecution := true

For some reason it resolves the following path:

https://dev-iesl.cs.umass.edu/nexus/content/repositories/snapshots/cc/factorie/factorie_2.11/1.2-SNAPSHOT/factorie_2.11-1.2-20151007.170205-28.${package.type}

Rather than the correct path to the jar:

https://dev-iesl.cs.umass.edu/nexus/content/repositories/snapshots/cc/factorie/factorie_2.11/1.2-SNAPSHOT/factorie_2.11-1.2-20151007.170205-28.jar

It seems as though ${package.type} is being interpreted as a literal file extension rather than whatever the contents of the variable package.type, but I have no idea why; I am using the simplest possible build configuration! As far as I know, I don't have any weird sbt configurations lying around (or any at all -- I checked ~/.sbt, and I have tried running on multiple machines).

Upvotes: 1

Views: 603

Answers (2)

John Sullivan
John Sullivan

Reputation: 1311

As @kawty says it does look like the pom in question is malformed, but in terms of fixing your sbt script, you can change you dependency line to:

libraryDependencies += "cc.factorie" %% "factorie" % "1.2-SNAPSHOT" artifacts( Artifact("factorie", "", "jar"))

to manually specify the extension of the artifact that you want.

Upvotes: 4

kawty
kawty

Reputation: 1656

A following line found in factorie_2.11-1.2-20151007.170205-28.pom:

<packaging>${package.type}</packaging>

I suppose sbt uses this setting to get the artifact.

In the previous .pom file, it has:

<packaging>jar</packaging>

So, maybe it's a broken build.

Upvotes: 1

Related Questions