简体   繁体   中英

play framework - error parsing expression in build.sbt

I am getting this strange parsing exception while trying to build my play project. It complains about the semi-colon that is no where in the file. Below is the error message and an extract from the build.sbt (line 12 & 13) file.

.../zentasks/build.sbt:12: error: eof expected but ';' found.
libraryDependencies += javaEbean
^
[error] Error parsing expression.  Ensure that settings are separated by blank lines.

Build.sbt file:

...
libraryDependencies += javaJdbc
libraryDependencies += javaEbean
...

Note :

I have got the solution but thought of putting up this question/solution for a while so that other newbies like me don't waste any time figuring this problem.

: I dont understand why play throws this confusing error message. :我不明白为什么游戏会引发此令人困惑的错误消息。 I don't see where that semi-colon is. However the solution is to separate the dependencies by blank line as follows:

libraryDependencies += javaJdbc

libraryDependencies += javaEbean

Also refer: http://www.scala-sbt.org/release/docs/Getting-Started/Basic-Def.html#how-build-sbt-defines-settings

Note: feel free to add to the solution or correct it.

I agree, the semicolon stuff is a bit misleading. On the other hand it also told you: Ensure that settings are separated by blank lines. :)

If you prefer a more compact way you could also write:

libraryDependencies ++= Seq(
     javaJdbc,
     javaEbean 
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM