Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play2: Difference between appDependencies and libraryDependencies?

in a Playframework 2 App (2.2.x) there is a build.sbt file. In this file one should specify the dependencies the app has.

Some docs write about

val appDependencies = Seq(put dependencies here)

and in the default there is a

libraryDependencies ++= Seq(put dependencies here)

When to take what? What is the difference between appDependencies and libraryDependencies?

Cheers

like image 636
Bijan Avatar asked Nov 16 '13 14:11

Bijan


1 Answers

I guess you are mixing up sbt build.sbt and Build.scala definitions (see sbt Build definition).

libraryDependencies is a key defined by sbt you can use in build.sbt files (which are basically key-value-stores). However, there is no predefined appDependencies key.

The example you gave

val appDependencies = Seq(put dependencies here)

is just a vanilla variable that could have any arbitrary name. You could as well name it dependenciesForTehLulz. The reason is that this variable is used to pass the dependencies to the Project definition constructor later, and its name simply doesn't matter:

val main = play.Project(appName, appVersion, **appDependencies**).settings(
    ...
)

This is only possible in Build.scala-style project definitions.

like image 110
Leo Avatar answered Nov 12 '22 00:11

Leo