Skeleton for my Scala projects
This is a skeleton I use for most of my Scala projects. It includes common libraries, SBT settings and plugins, etc. Feel free to use if you find it useful.
After you checkout the project, edit build.sbt
and set the name
variable. Then run
git remote remove origin
so you don't push project-specific changes back into the skeleton project.
You will need Java 8 installed. The app will download any additional dependencies.
The app uses sbt to build and package the app. If you don't have sbt installed, you can use the bundled sbt runner (./sbt).
The first time you build the app, it will need to download dependencies and compile support code. This will take several minutes, but it only happens on the first build.
To run unit tests, run
./sbt test
This will not interact with AWS, so you don't need to setup AWS credentials to test the app.
To generate a code coverage report run,
./sbt clean coverage test coverageReport
The HTML report will be written to target/scala-2.11/scoverage-report/index.html
.
The project uses the scapegoat tool for code quality analysis. Run run a scapegoat report, run
./sbt scapegoat
The HTML report will be written to target/scala-2.11/scapegoat-report/scapegoat.html
The project uses the sbt-dependency-check tool to query the OWASP Dependency Check database. You can check the project's depenencies for known security vulnerability by running
./sbt check
The HTML report will be written to target/scala-2.11/dependency-check-report.html
Note - the first time you run this command it will take much longer than normal because it has to download the vulnerability database from OWASP.
The project depends on Scala and its build tool, sbt. If the sbt
script fails to install Scala and SBT, you can manually install them.
On OS X, assuming you have homebrew installed, the easiest way to install these is via:
brew install scala sbt
Alternatively, you can download native OS packages from the links above.