我是SBT的新手,并且没有Maven的经验。 我正在尝试将依赖项JWPL添加到我的项目中。我查看了their developer setup page并找到了一个可以添加到Maven安装文件以下载项目的示例:
从链接:
<dependency>
<groupId>de.tudarmstadt.ukp.wikipedia</groupId>
<artifactId>de.tudarmstadt.ukp.wikipedia.api</artifactId>
<version>0.9.2</version>
</dependency>
我将build.sbt
文件翻译为:
addSbtPlugin("de.tudarmstadt.ukp.wikipedia" % "de.tudarmstadt.ukp.wikipedia.api" % "0.9.2")
但是,在sbt
中,当我运行更新时,我得到:
> update
[info] Updating {file:/home/me/scala/wikifun/}wikifun...
[info] Resolving de.tudarmstadt.ukp.wikipedia#de.tudarmstadt.ukp.wikipedia;0.9.2 ...
[warn] module not found: de.tudarmstadt.ukp.wikipedia#de.tudarmstadt.ukp.wikipedia;0.9.2
[warn] ==== local: tried
[warn] /home/me/.ivy2/local/de.tudarmstadt.ukp.wikipedia/de.tudarmstadt.ukp.wikipedia/scala_2.10/sbt_0.13/0.9.2/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/de/tudarmstadt/ukp/wikipedia/de.tudarmstadt.ukp.wikipedia_2.10_0.13/0.9.2/de.tudarmstadt.ukp.wikipedia-0.9.2.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: de.tudarmstadt.ukp.wikipedia#de.tudarmstadt.ukp.wikipedia;0.9.2: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] de.tudarmstadt.ukp.wikipedia:de.tudarmstadt.ukp.wikipedia:0.9.2 (sbtVersion=0.13, scalaVersion=2.10)
[warn]
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: de.tudarmstadt.ukp.wikipedia#de.tudarmstadt.ukp.wikipedia;0.9.2: not found
[error] Total time: 9 s, completed Nov 20, 2013 11:23:19 AM
除了手头的问题之外,任何帮助理解构建过程中的内容都会受到赞赏,所以我可以在将来自己解决问题。
答案 0 :(得分:4)
将其添加到您的构建文件中:
libraryDependencies += "de.tudarmstadt.ukp.wikipedia" % "de.tudarmstadt.ukp.wikipedia.api" % "0.9.2"
您使用的方法(addSbtPlugin)(顾名思义)用于将插件添加到SBT(无论如何都应该插入插件.sbt文件中)。
另见http://www.scala-sbt.org/release/docs/Getting-Started/Basic-Def.html#adding-library-dependencies