問題描述
如何配置我的 SBT 以使用帶有指定插件的插件? (How to configure my SBT to use a plugin with a specified plugin?)
I want to use the lifty plugin, but failed to download it in SBT.
C:\Users\Freewind>sbt sbt‑version
[info] 0.12.3
> console
Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64‑Bit Server VM, Java 1.7.0_04).
I followed the document of lifty, to insert the code to my project/plugins.sbt
:
resolvers += Resolver.url("sbt‑plugin‑releases",
new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt‑plugin‑releases/"))(Resolver.ivyStylePatterns)
addSbtPlugin("org.lifty" % "lifty" % "1.7.4")
And to my build.sbt
:
seq( Lifty.liftySettings : _*)
It reports warnings when I run sbt
:
[warn] module not found: org.lifty#lifty;1.7.4
[warn] ==== typesafe‑ivy‑releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy‑releases/org.lifty/lifty/scala_2.9.2/sbt_0.12/1.7.4/ivys/ivy.xml
[warn] ==== sbt‑plugin‑releases: tried
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt‑plugin‑releases/org.lifty/lifty/scala_2.9.2/sbt_0.12/1.7.4/ivys/ivy.xml
[warn] ==== local: tried
[warn] X:\.sbt\local\org.lifty\lifty\scala_2.9.2\sbt_0.12\1.7.4\ivys\ivy.xml
[warn] ==== sbt‑plugin‑releases: tried
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt‑plugin‑releases/org.lifty/lifty/scala_2.9.2/sbt_0.12/1.7.4/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/lifty/lifty_2.9.2_0.12/1.7.4/lifty‑1.7.4.pom
You can see it tries to find somewhere include lifty\scala_2.9.2\sbt_0.12
But from the resolver, I can find one valid url of:
http://scalasbt.artifactoryonline.com/scalasbt/sbt‑plugin‑releases/org.lifty/lifty/scala_2.9.1/sbt_0.11.2/1.7.4/
It only supports scala_2.9.1
and sbt‑0.11.2
.
How to change my configuration to use this specified version of lifty?
參考解法
方法 1:
They dont have a versino for scala 2.10 at the moment, so you can't use it with you configuration
方法 2:
In your sbt build definition file build.sbt
change the scala version to
scalaVersion := 2.9.1
that should work.
Also FYI,
lifty is not under development any more. https://github.com/Lifty/lifty
(by Freewind、4lex1v、Rajesh Pitty)