playframework - Explain Build.scala in play framework -
can explain syntax build.scala in detail? example, have following build.scala
:
import sbt._ import keys._ import play.project._ object build extends sbt.build { val appname = "myapp" val appversion = "1.0" val appdependencies = seq( "postgresql" % "postgresql" % "9.1-901-1.jdbc4", javacore, javajdbc, javaebean, "org.json" %"org.json" % "chargebee-1.0", "org.reflections" % "reflections" % "0.9.8", "org.mockito" % "mockito-all" % "1.9.5" % "test" ) val main = play.project(appname, appversion, appdependencies).settings( librarydependencies += "com.jolbox" % "bonecp" % "0.8.0-rc2-snapshot", resolvers += resolver.url("sbt-plugin-snapshots", new url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/"))(resolver.ivystylepatterns), resolvers += "sonatype oss snapshots" @ "https://oss.sonatype.org/content/repositories/snapshots/" ) }
how match appdependencies
resolvers
? or how know resolvers
need add appdependencies
? in resolver's repo? librarydependencies
? how different appdependencies
?
thanks.
there few things need disentangle here.
let's first distinguish between sbt build file , build.scala
. while build file maven pom or gradle build file, think of build.scala
build capability full power , expressiveness of scala because scala class other. believe gap between 2 has narrowed though latest version of sbt.
now in both sbt , build.scala
, have notion of library dependencies, jar libraries containing code can use projects. these libraries can found in lots of places--maven repositories, local file system, etc. use resolvers specify locations.
so tell both jars need , find them.
as appdependencies
, that's not thing. said, build.scala
class other, , appdependencies
variable name. makes sense use name because seq
pass project
constructor.
Comments
Post a Comment