【问题标题】:Ambiguous reference when using sbt-native-packager使用 sbt-native-packager 时的模糊参考
【发布时间】:2015-02-16 12:00:02
【问题描述】:

我正在尝试使用 sbt-native-packager 创建一个 deb 文件。当我运行 sbt 时,它会在加载 build.sbt 时抱怨引用不明确:

mydir/build.sbt:21: error: reference to maintainer is ambiguous;
it is imported twice in the same scope by
import NativePackagerKeys._
and import _root_.com.typesafe.sbt.SbtNativePackager.autoImport._
maintainer in Debian := "Your Name <your@email.com>"

[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

我的 build.sbt 是:

import com.typesafe.sbt.SbtNativePackager._
import NativePackagerKeys._

organization := "org.bodhi"

name := "HelloRemote"

version := "1.0"

scalaVersion := "2.11.4"

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

libraryDependencies ++= Seq(
  "com.typesafe.akka" %% "akka-actor" % "2.3.4",
  "com.typesafe.akka" %% "akka-remote" % "2.3.4"
)

packageArchetype.java_application

maintainer in Debian := "Your Name <your@email.com>"

我正在使用 sbt 0.13.7;我的 packager.sbt 文件包含: addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.0-M3")

谢谢

【问题讨论】:

    标签: sbt sbt-native-packager


    【解决方案1】:

    只需删除 import NativePackagerKeys._

    【讨论】:

    • 谢谢,这可行,但与插件的文档相矛盾:scala-sbt.org/sbt-native-packager/DetailedTopics/debian.html 此外,如果我在 Debian 中使用 'maintainer := Joe",我仍然会收到错误。这是不是文档不存在的情况当前,并非所有错误都已解决?
    • 我使用 sbt-native-packager-1.0.0-M3 并使用以下导入:import com.typesafe.sbt.packager.Keys._ import com.typesafe.sbt.SbtNativePackager._跨度>
    猜你喜欢
    • 2016-12-14
    • 2014-01-27
    • 2015-07-25
    • 2017-01-25
    • 2014-06-02
    • 2015-10-03
    • 2015-10-11
    • 2013-11-16
    • 2014-01-09
    相关资源
    最近更新 更多