Build.scala, % and %% symbols meaning

From the official documentation:

http://www.playframework.com/documentation/2.1.1/SBTDependencies

Getting the right Scala version with %%

If you use groupID %% artifactID % revision instead of groupID % artifactID % revision (the difference is the double %% after the
groupID), SBT will add your project’s Scala version to the artifact
name. This is just a shortcut.

You could write this without the %%:

val appDependencies = Seq(
  "org.scala-tools" % "scala-stm_2.9.1" % "0.3"
)

Assuming the scalaVersion for your build is 2.9.1, the following is identical:

val appDependencies = Seq(
  "org.scala-tools" %% "scala-stm" % "0.3"
)

As you can see above, if you use %%, you don’t have to specify the
version.

Leave a Comment