简体   繁体   English

sbt没有解决依赖关系; 路径正确,但$ {package.type}扩展名除外

[英]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 : sbt(0.13.8)无法解决以下极其简单的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} 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 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; 似乎${package.type}被解释为文字文件扩展名,而不是变量package.type的内容,但是我不知道为什么; 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). 据我所知,我周围没有任何奇怪的sbt配置(或根本没有-我检查了~/.sbt ,并且我尝试在多台机器上运行)。

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: 正如@kawty所说的,它看起来确实像是问题的pom格式不正确,但是就修复sbt脚本而言,您可以将依赖项行更改为:

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

to manually specify the extension of the artifact that you want. 手动指定所需工件的扩展名。

A following line found in factorie_2.11-1.2-20151007.170205-28.pom : factorie_2.11-1.2-20151007.170205-28.pom中找到以下行:

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

I suppose sbt uses this setting to get the artifact. 我想sbt使用此设置来获取工件。

In the previous .pom file , it has: 在上一个.pom文件中 ,它具有:

<packaging>jar</packaging>

So, maybe it's a broken build. 因此,也许是一个残破的构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM