【问题标题】:What is the repository for scrooge-sbt-plugin?scrooge-sbt-plugin 的存储库是什么?
【发布时间】:2013-11-03 18:50:24
【问题描述】:

当前版本的 scrooge-sbt-plugin 的存储库是什么?还是设置说明已过时?

根据the documentation,我将它添加到了一个 Play Framework 项目中:

在项目/plugins.sbt中

addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "3.3.2")

在 build.sbt 中:

com.twitter.scrooge.ScroogeSBT.newSettings

libraryDependencies ++= Seq(
  "org.apache.thrift" % "libthrift" % "0.8.0",
  "com.twitter" %% "scrooge-core" % "3.3.2",
  "com.twitter" %% "finagle-thrift" % "6.5.0"
)

play clean-allplay-compile 之后我得到这个输出:

[warn]  module not found: com.twitter#scrooge-sbt-plugin;3.3.2
[warn] ==== typesafe-ivy-releases: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/com.twitter/scrooge-sbt-plugin/scala_2.10/sbt_0.13/3.3.2/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.twitter/scrooge-sbt-plugin/scala_2.10/sbt_0.13/3.3.2/ivys/ivy.xml
[warn] ==== local: tried
[warn]   /opt/play-2.2.0/repository/local/com.twitter/scrooge-sbt-plugin/scala_2.10/sbt_0.13/3.3.2/ivys/ivy.xml
[warn] ==== Maven2 Local: tried
[warn]   file:/home/fernando/.m2/repository/com/twitter/scrooge-sbt-plugin_2.10_0.13/3.3.2/scrooge-sbt-plugin-3.3.2.pom
[warn] ==== sonatype-oss-snapshots: tried
[warn]   http://oss.sonatype.org/content/repositories/snapshots/com/twitter/scrooge-sbt-plugin_2.10_0.13/3.3.2/scrooge-sbt-plugin-3.3.2.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/com/twitter/scrooge-sbt-plugin_2.10_0.13/3.3.2/scrooge-sbt-plugin-3.3.2.pom
[warn] ==== Typesafe repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/twitter/scrooge-sbt-plugin_2.10_0.13/3.3.2/scrooge-sbt-plugin-3.3.2.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.twitter#scrooge-sbt-plugin;3.3.2: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]      com.twitter:scrooge-sbt-plugin:3.3.2 (sbtVersion=0.13, scalaVersion=2.10)
[warn] 
sbt.ResolveException: unresolved dependency: com.twitter#scrooge-sbt-plugin;3.3.2: not found

maven.twttr.com 似乎有一个 3.3.1 版本。版本 3.3.2 怎么样?我在 mvnrepository.com 或 oss.sonatype.org 上找不到它。

【问题讨论】:

    标签: scala playframework sbt thrift scrooge


    【解决方案1】:

    存储库位于https://oss.sonatype.org/content/groups/public


    查看Build.scala,您可以了解他们发布到哪个存储库。

    如果您查看https://oss.sonatype.org/content/groups/public/com/twitter/ 并搜索“scrooge-sbt-plugin”,您会找到以“_0.12”结尾的文件夹,因此它作为 SBT 0.12.x 插件在那里发布。您可能无法将此插件用于 Play 2.2.x,因为它使用 SBT 0.13.x。

    版本 3.3.2 不是最新版本,我无法解决所有文件。使用 3.9.2 有效:

    project/build.properties 必须包含 SBT 0.12(示例):

    sbt.version=0.12.2
    

    project/plugins.sbt 必须包含解析器:

    resolvers += "sonatype" at "https://oss.sonatype.org/content/groups/public"
    
    addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "3.9.2") 
    

    最后 build.sbt 或 Build.scala 必须包含:

    com.twitter.scrooge.ScroogeSBT.newSettings
    
    scalaVersion := "2.10.1"
    
    libraryDependencies ++= Seq(
      "org.apache.thrift" % "libthrift" % "0.8.0",
      "com.twitter" %% "scrooge-core" % "3.9.2",
      "com.twitter" %% "finagle-thrift" % "6.5.0"
    ) 
    

    【讨论】:

    • 两年过去了,还是没有sbt 0.13版本:-(
    【解决方案2】:

    首先,3.16.3版本是sbt 0.13.x的最新版本

    存储库是什么意思?

    代码库在 GitHub 上,所有 Scrooge 的东西,包括 sbt-plugin 的东西都在那里。

    至于工件存储库,我很确定它位于 maven Central 或其他一些标准存储库上。您不必在 sbt 构建中添加解析器。但是,如果您出于某种原因这样做,那么@Schleichardt 提到的 sonatype 似乎是正确的。

    【讨论】:

    • 发布了一个 PR 来尝试将这条信息放在正确的位置。 github.com/twitter/scrooge/pull/150
    • 那么...这是合并了吗?因为看起来这只会影响scrooge-core 版本而不是scrooge-sbt-plugin 版本。
    • 它没有被合并,但据说它是由其他一些提交更新的......不能保证这一点。如果您未绑定 Thrift,请考虑使用远程 (oncue.github.io/remotely) 以获得更好的体验。祝你好运!
    • 我明白了。不绑定任何东西,但我需要一种格式,用于在用 python 编写的系统和用 scala 编写的系统之间交换数据。如果我错了,请纠正我,但我认为这是 thrift/protobuf 的全部意义 - 系统集成。
    • 嗯,他们将 RPC 与互操作性混为一谈。有时,如果远程节点使用相同的软件堆栈,即编程语言,您可以使用更适合该语言的 RPC 框架。我认为 Go 有一个集成的 RPC,而 Remotely 将是 Scala 编程语言的一个选择。但是对于您的用例,听起来您被困在一个最小公分母解决方案中,例如 Thrift,它既可以实现 RPC,又可以在多种语言之间实现互操作性。很抱歉听到这种情况:-)
    猜你喜欢
    • 2016-05-02
    • 2014-09-29
    • 2012-07-04
    • 1970-01-01
    • 2014-12-05
    • 2017-10-09
    • 1970-01-01
    • 2018-09-09
    • 2016-11-08
    相关资源
    最近更新 更多