【问题标题】:How to install sbt-sh plugin如何安装 sbt-sh 插件
【发布时间】:2016-07-02 08:11:09
【问题描述】:

https://github.com/steppenwells/sbt-sh

我正在使用 sbt 0.13.9 并尝试按照给定的说明安装 sbt-sh。但是 sbt 不识别 sh 命令:

> sh ls
[error] Expected ID character
[error] Not a valid command: sh
[error] Expected 'show'
[error] Expected project ID
[error] Expected configuration
[error] Expected ':' (if selecting a configuration)
[error] Expected key
[error] Not a valid key: sh
[error] sh ls
[error]   ^
>

说明适用于 sbt 0.10,也许从那时起情况发生了变化,本指南已过时?

【问题讨论】:

    标签: scala plugins sbt


    【解决方案1】:

    说明有点过时了。您应该将 MyPlugins 对象放在 ~/.sbt/0.13/plugins/project/MyPlugins.scala 中,而不是 ~/.sbt/plugins/project

    但是,sbt-sh 似乎不起作用,即使进行了更正:

    [error] $HOME/.sbt/0.13/staging/1375c2d4ab8153e18523/sbt-sh/src/main/scala/org/sbtsh/SbtShPlugin.scala:4: object CommandSupport is not a member of package sbt
    [error] import sbt.CommandSupport._
    [error]            ^
    [error] one error found
    [error] ({git://github.com/steppenwells/sbt-sh.git}sbt-sh/compile:compileIncremental) Compilation failed
    

    你可以试试xsbt-sh吗?

    使用此内容创建一个文件~/.sbt/0.13/plugins/xsbt-sh.sbt

    resolvers += "Element Releases" at "http://repo.element.hr/nexus/content/repositories/releases/"
    
    addSbtPlugin("hr.element.xsbt" % "xsbt-sh" % "0.0.2")
    

    Github README 引用 0.1.0,但似乎尚未发布到存储库。

    【讨论】:

      猜你喜欢
      • 2020-03-06
      • 2018-10-29
      • 2015-05-01
      • 2018-05-13
      • 2015-05-31
      • 2012-01-14
      • 1970-01-01
      • 2015-10-24
      • 2013-03-23
      相关资源
      最近更新 更多