首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么SBT找不到Play 2.1插件?

为什么SBT找不到Play 2.1插件?
EN

Stack Overflow用户
提问于 2013-01-29 08:11:06
回答 2查看 9.7K关注 0票数 9

在我的plugins.sbt文件中,我有

代码语言:javascript
复制
scalaVersion := "2.10.0"

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("play" % "sbt-plugin" % "2.1")  

当我尝试运行sbt时,我得到了

代码语言:javascript
复制
[warn] ==== Typesafe repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.10_0.12/2.1/sbt-        plugin-2.1.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/play/sbt-plugin_2.10_0.12/2.1/sbt-plugin-2.1.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: play#sbt-plugin;2.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these         dependencies exist with the requested attributes.
[warn]          play:sbt-plugin:2.1 (sbtVersion=0.12, scalaVersion=2.10)
[warn]
sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.1: not found

为什么SBT找不到插件?我也尝试过addSbtPlugin("play" % "sbt-plugin" % "2.1-RC1"),也有类似的结果。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-01-29 10:33:45

问题是在plugins.sbt文件中包含scalaVersion设置。这会导致sbt在存储库中搜索sbt-plugin_2.10.0_0.12,而实际上应该搜索sbt-plugin_2.9.2_0.12。

我不确定在plugins.sbt文件中指定scalaVersion背后的语义,但可能它声明了运行SBT的Scala版本。

以下是Play 2.1SBT插件文件的链接:http://repo.typesafe.com/typesafe/simple/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.1-RC1/srcs/

票数 5
EN

Stack Overflow用户

发布于 2013-02-06 21:37:10

根据文档,在您的project/plugins.sbt中添加以下内容

代码语言:javascript
复制
addSbtPlugin("play" % "sbt-plugin" % "2.1.0")

更改project/build.properties

代码语言:javascript
复制
sbt.version=0.12.2
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14573574

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档