2015-01-12 2 views
6

에 대한 -FEATURE 실행 재-I 오류 there were 15 feature warning(s); re-run with -feature for details 수 :sbt 0.12.4 - x 기능 경고가있었습니다. 자세한

scalaVersion := "2.10.4" 

build.sbt 에서

$ /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 

을 나는 '아무튼 때문 오류가 무엇인지 찾을 수 없습니다 심지어 내가 012b로 sbt를 실행할 때 말하십시오.

$ /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 :

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

오류가 동일하다 :

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

또는 SBT 자체

build.sbt.

+1

http://stackoverflow.com/questions/9578521/scala-sbt-how-to-re-run-with-deprecation –

+0

SOM-snytt @, 그것은 도움이되지 않았다. –

+0

'-feature'를 원합니다. –

답변

6

나는 매일 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 

를 이봐, 그것은했다!

2

당신은 당신의 build.sbt에

scalacOptions += "-feature" 

을 추가하고 SBT 콘솔이 실행중인 경우 다시로드를 실행 (또는 다시 시작)해야한다. 당신은 SBT 콘솔에서, 당신은 set scalacOptions += "-feature"을 쓸 수 있지만, 단 하나의 세션을 설정하려면

는 다른 방법으로,이 설정은 즉시 다시로드 또는 SBT 콘솔을 다시 시작할 필요가 적용되지 않습니다.

Re-run with -feature for details