【问题标题】:Phantom Dependencies Error幻影依赖错误
【发布时间】:2016-12-27 16:16:28
【问题描述】:

我尝试将 phantom 集成到我的项目中:这是我的 build.sbt 文件:

resolvers ++= Seq (
"Java.net Maven2 Repository"       at "http://download.java.net/maven/2/",
"Twitter Repository"               at "http://maven.twttr.com",
Resolver.typesafeRepo("releases"),
Resolver.sonatypeRepo("releases"),
Resolver.bintrayRepo("websudos", "oss-releases")
)

libraryDependencies ++= {
val phantomV = "1.27.0"
Seq(
"com.websudos"  %% "phantom-connectors"            % phantomV,
"com.websudos"  %% "phantom-dsl"                   % phantomV,
"com.websudos"  %% "phantom-example"               % phantomV,
"com.websudos"  %% "phantom-finagle"               % phantomV,
"com.websudos"  %% "phantom-thrift"                % phantomV,
"com.websudos"  %% "phantom-udt"                   % phantomV,
"com.websudos"  %% "phantom-sbt"                   % phantomV
)}

这是我的插件.sbt

def websudosPattern = {
  val pList = List("[organisation]/[module](_[scalaVersion])(_[sbtVersion])/[revision]/[artifact]-[revision](-[classifier]).[ext]")
 Patterns(pList, pList, true)}

resolvers ++= Seq(
Resolver.url("Maven ivy Websudos", 
url(Resolver.DefaultMavenRepositoryRoot))(websudosPattern))

我点击链接:https://github.com/outworkers/phantom/wiki/Integrating-phantom-in-your-project

但我仍然收到错误:未解决的依赖项:com.websudos#phantom-udt_2.11;1.27.0:未找到&&未解决的依赖项:com.websudos#phantom-sbt_2.11;1.27.0:未找到

谁能告诉我我的代码有什么问题。非常感谢。

build.sbt

scalaVersion := "2.11.6"
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8")

  resolvers ++= Seq(
    "Java.net Maven2 Repository" at "download.java.net/maven/2/";,  
    "Twitter Repository" at "maven.twttr.com",
    Resolver.typesafeRepo("releases"),
    Resolver.sonatypeRepo("releases"),
    Resolver.bintrayRepo("websudos", "oss-releases")
  ) 

  libraryDependencies ++= {
    val akkaV = "2.3.9"
    val sprayV = "1.3.3"
    val phantomV = "1.27.0"
    Seq(
      "com.websudos" %% "phantom-dsl" % phantomV,
      "io.spray" %% "spray-can" % sprayV,
      "io.spray" %% "spray-routing" % sprayV,
      "io.spray" %% "spray-testkit" % sprayV % "test",
      "io.spray" %% "spray-json" % "1.3.2",
      "io.spray" %% "spray-routing-shapeless2" % sprayV,  
      "com.typesafe.akka" %% "akka-actor" % akkaV,
      "com.typesafe.akka" %% "akka-testkit" % akkaV % "test",
      "org.specs2" %% "specs2-core" % "2.3.11" % "test"
    )
  }

【问题讨论】:

  • 题外话,Spray 已被弃用,如果您已经拥有 Spray 测试套件,则不需要显式依赖 Akka 或 Akka-teskit。 Spray 引入了自己的 Akka 版本,您也不需要 Specs 2 依赖项。

标签: scala cassandra spray phantom-dsl


【解决方案1】:

根据文档,您真正需要开始的是:

val phantomV = "1.27.0"

libraryDependencies ++= Seq(
  "com.websudos"  %% "phantom-dsl" % phantomV
)

我已经更新了文档以更正我们这边的一个错误,UDT 模块尚不可用,请在未来的版本中留意它。

【讨论】:

  • 非常感谢您的帮助。我在 build.sbt 文件中只留下 "com.websudos" %% "phantom-dsl" % phantomV 。错误消失了。但是当我尝试导入 com.websudos.phantom.dsl._ 时,它显示“对象 websudos 不是包 com 的成员”。是不是我做错了什么?非常感谢您的帮助。
  • 我在项目的引用库中没有找到“com.websudos”。
  • @JenniferHe 你能把你的build.sbt粘贴到这里吗?添加依赖后忘记sbt reload了吗?
  • 非常感谢您的回复。我确实重新加载了 sbt。这是我的 build.sbt 文件:
  • scalaVersion := "2.11.6" scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8")
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-12-13
  • 2018-04-10
  • 2015-02-10
  • 2020-01-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多