Creating an sbt project from scratch

By Andres Jaimes

- 1 minutes read - 98 words

sbt projects use the same structure as Maven. Creating a project from scratch involve the following steps:

mkdir some-new-project
cd some-new-project
mkdir -p src/{main,test}/{resources,scala}
mkdir project

Create a new file called build.sbt and add the following contents:

name := "SomeNewProject"
version := "1.0"
scalaVersion := "2.13.5"

Our final folder structure has to look like this:

├── build.sbt
├── project
└── src
    ├── main
    │   ├── resources
    │   └── scala
    └── test
        ├── resources
        └── scala

Done. Go ahead and try sbt clean or sbt compile. We are ready to start adding code to our folders.

Happy coding.