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

家住魔仙堡 提交于 2019-12-23 02:36:37

问题


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).


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/33290778/sbt-not-resolving-dependency-path-correct-except-package-type-extension

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!