sbt 0.12.4 - 有 x 功能警告;使用 -feature 重新运行以获取详细信息

2024-02-22

我收到一个错误there were 15 feature warning(s); re-run with -feature for details :

$ /usr/local/sbt/bin/sbt
[info] Loading project definition from /home/alex/Documents/projects/my_app123/project
[info] Set current project to sbt-android (in build file:/home/alex/Documents/projects/my_app123/)

> compile -feature
[error] Expected end of input.
[error] compile -feature
[error]        ^

> sbt-version
[info] 0.12.4

> compile 
[warn] Credentials file /home/alex/.ivy2/.credentials does not exist
[info] Compiling 20 Scala sources to /home/alex/Documents/projects/my_app123/target/scala-2.10/sbt-0.12/classes...
[error] there were 15 feature warning(s); re-run with -feature for details
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 27 s, completed 01 12, 15 1:20:12 PM

In 构建.sbt

scalaVersion := "2.10.4"

我无法找出该错误是什么,因为它没有这么说,即使我运行 sbt 作为$ /usr/local/sbt/bin/sbt -feature.

$ /usr/local/sbt/bin/sbt -feature
[info] Loading project definition from /home/alex/Documents/projects/my_app123/project
[info] Set current project to sbt-android (in build file:/home/alex/Documents/projects/my_app123/)
$

这是 JDK 1.7

错误是什么以及如何修复它?

UPDATE:

构建.sbt

scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation")

或者在 sbt 本身中:

> set scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation")

错误仍然相同。


我没有机会每天使用 sbt,所以这只是为了确认链接答案中的建议:

$ sbt
[info] Set current project to Compiler options (in build file:/home/apm/tmp/sbtwarn/)
> compile
[info] Compiling 1 Scala source to /home/apm/tmp/sbtwarn/target/scala-2.11/classes...
[warn] there was one feature warning; re-run with -feature for details
[warn] one warning found
[success] Total time: 4 s, completed Jan 12, 2015 9:45:17 AM
> set scalacOptions in ThisBuild ++= Seq("-feature")
[info] Defining {.}/*:scalacOptions
[info] The new value will be used by compile:scalacOptions
[info] Reapplying settings...
[info] Set current project to Compiler options (in build file:/home/apm/tmp/sbtwarn/)
> compile
[info] Compiling 1 Scala source to /home/apm/tmp/sbtwarn/target/scala-2.11/classes...
[warn] /home/apm/tmp/sbtwarn/src/main/scala/Sample.scala:6: postfix operator head should be enabled
[warn] by making the implicit value scala.language.postfixOps visible.
[warn] This can be achieved by adding the import clause 'import scala.language.postfixOps'
[warn] or by setting the compiler option -language:postfixOps.
[warn] See the Scala docs for value scala.language.postfixOps for a discussion
[warn] why the feature should be explicitly enabled.
[warn]   Console println (List(1,2,3) head)
[warn]                                ^
[warn] one warning found
[success] Total time: 1 s, completed Jan 12, 2015 9:45:46 AM

嘿,成功了!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

sbt 0.12.4 - 有 x 功能警告;使用 -feature 重新运行以获取详细信息 的相关文章

  • scala:抽象类实例化?

    我怎么会实例化一个抽象类呢 abstract class A val a Int val a new A val a 3 或者是隐式创建了一些具体的类 那些大括号之后是做什么用的new A mean 这样 您就隐式扩展了A 你所做的是语法糖
  • 组合多个任意长度的列表

    我正在寻找一种通过以下方式加入多个列表的方法 ListA a b c ListB 1 2 3 4 ListC Resulting List a 1 b 2 c 3 4 换句话说 元素按顺序排列 从第一个列表开始组合到结果列表中 任意数量的输
  • Scala 函数定义参数列表中不同的括号样式

    Scala 中以下两个函数定义有什么区别 1 def sum f Int gt Int a Int b Int Int code 2 def sum f Int gt Int a Int b Int Int code SBT 的控制台 RE
  • Playframework 2.0 在视图模板中定义函数

    我正在开发一个使用 PlayFramework 2 0 的项目 在阅读了一些 scala 之后 我想在视图模板中嵌入一些动态代码 所以 我做了以下事情 def getMystring sequence Int if patternForm
  • 自动将通配符导入重构为 IntelliJ 中的显式导入(适用于 Scala/Java)

    考虑下面的代码 是否可以让 IntelliJ 自动将每个通配符导入重构为显式导入 无论范围内使用什么 例如import scalatags JsDom all into import scalatags JsDom all ol li di
  • IntelliJ IDEA 13 给出有关不兼容类型的无效错误(Play 中的 Java-Scala-InterOp)

    我刚刚从 IDEA 12 升级到 13 社区版 从那时起 我在 IDEA 中收到关于我的游戏项目的类型不兼容的错误 Option
  • Scala:如何定义带有变量参数列表的匿名函数?

    在 Scala 中 如何定义接受可变数量参数的匿名函数 scala gt def foo blah Int gt 3
  • Akka/Scala:映射 Future 与 pipelineTo

    In Akka参与者 在发送一个Future结果给另一个演员 A 映射Future发挥作用tell结果给演员 B 定义一个onSuccess未来的回调 其中tell结果给演员 C 管道Future结果给演员pipeTo 其中一些选项已在上一
  • 如何使用 `ProjectRef` 来引用 sbt 1.x 中的本地项目?

    其他答案中有很多含糊不清的内容 或者涉及到更旧版本的 sbt 即 0 12 x 但似乎没有人真正回答这个问题 鉴于我有一个文件夹 并且我已经运行 sbt new scala scala seed g8 name Scala Seed Pro
  • 在 scala 中保留推导的更高类型

    我有一个高阶类型 并致力于用它构建一些 DSL 我正在寻找一种方法来定义可以接受类型而无需显式指定此类型的函数 自我描述示例 class Wrap T val data T class DSL def doSomething T x Wra
  • Scala:需要类类型,但找到了 T

    我发现了与此特定问题类似的问题 但是该问题是由于有人试图直接实例化 T 造成的 在这里 我试图创建一个特征 它是一个通用接口来扩展类并将它们自动存储在数据库中 例如 Riak 使用classOf T 使用 Scala 2 10 这是我的代码
  • 为什么 Cassandra 客户端在生产中没有 epoll 时会失败? [复制]

    这个问题在这里已经有答案了 当我在本地运行服务时 我收到一条警告 指出 epoll 不可用 因此它使用 NIO 很公平 当我将其部署到 Kubernetes 中时 我得到了以下信息 这导致服务无法运行 2017 03 29T19 09 22
  • Play框架:读取包含空值的Json

    我正在尝试在 Play Scala 程序中读取 Json 数据 Json 的某些字段可能包含空值 因此我定义 Reads 对象的方式如下 implicit val readObj Reads ApplyRequest JsPath a re
  • Scala 中的 Apply 和 lambda

    我有下面的代码 scala gt val builder new StringBuilder foo bar baz builder StringBuilder foo bar baz scala gt 0 until 5 foreach
  • Scala 中缺少多重集吗?

    我正在尝试 Scala 中的 Facebook Hacker Cup 2013 资格赛问题 对于第三个问题 我觉得需要一个有序的 Multiset 但在 scala 的 2 10 集合中找不到一个 scala 的集合中是否缺少此数据结构 会
  • 带可变参数的 Spark UDF

    如文档中所示 列出最多 22 个参数是唯一的选择吗 https spark apache org docs 1 5 0 api scala index html org apache spark sql UDFRegistration ht
  • Scala:将整个列表的 Either 与每个元素的 Either 组合

    我有一个 Either 列表 它代表错误 type ErrorType List String type FailFast A Either ErrorType A import cats syntax either val l List
  • Scala 功能设计模式目录

    一周以来我一直在阅读 Scala 编程 作者一步一步地介绍了该语言的元素 但我仍然很困惑何时使用演员 闭包 柯里化等功能性的东西 我正在寻找功能结构的典型用例或最佳实践的目录 我并不是说在 Scala 中重新实现像 GoF 这样的众所周知的
  • scala.math.BigDecimal :1.2 和 1.20 相等

    将 Double 或 String 转换为 scala math BigDecimal 时如何保持精度和尾随零 用例 在 JSON 消息中 属性的类型为 String 值为 1 20 但是在 Scala 中读取这个属性并将其转换为 BigD
  • 按元素聚合数组

    Spark scala 相当新 我想知道是否有一种简单的方法以按列方式聚合 Array Double 这是一个例子 c1 c2 c3 1 1 1 0 1 0 3 4 1 2 1 0 0 0 4 3 2 1 0 0 0 0 0 0 2 3 1

随机推荐