Have fun with SBT Giter8 templates

Alexey Novakov
SE Notes by Alexey Novakov
1 min readMay 21, 2017

It has been really pleasure to find Giter8 as new sbt command, which is called “new” :-)

For instance, I want to create my next project based on Scala and Play! framework:

sbt new playframework/play-scala-seed.g8

Above command creates a template project where I can start my implementation from. Most of IDEs, such as IntelliJ IDEA have similar feature like creation of new project based on some library or framework. However, the nicest thing about Giter8 that you can:

  • create project based on the GitHub (or other site) hosted template
  • create your own template with the specific SBT settings, config, classes, etc.

Let’s run play-scala-seed

First of all install SBT 0.13.13 or higher version to have it available in your PATH:

bash-3.2$ sbt new playframework/play-scala-seed.g8
This template generates a Play Scala project
name [play-scala-seed]: my-play-apporganization [com.example]: org.alexeyscala_version [2.11.11]:play_version [2.5.14]:scalatestplusplay_version [2.0.0]:Template applied in ./my-play-app

I have left default version for Scala, Play, Scalatestpluplay, but you can set your preferred version of course.

Now what you get is

Just go and edit or remove whatever is not needed for your current application.

See more templates here: https://github.com/foundweekends/giter8/wiki/giter8-templates

--

--