Project Setup
Modules and Artifacts
Unfiltered’s core, binding, server, and other modules are published with references to their underlying dependencies, so that applications need only explicitly depend on Unfiltered and other top-level dependencies. Keep in mind that server modules and binding modules are not generally co-dependent, so that if you are using for example unfiltered-jetty, you will also need to specify unfiltered-filter.
Each module is cross-built against several versions of Scala and published to the maven central repository with the organization-id “ws.unfiltered”. The modules have the Scala version they are built against appended. For Scala 3+, the full artifact names are as follows:
- unfiltered_3
- unfiltered-filter_3
- unfiltered-filter-async_3
- unfiltered-netty_3
- unfiltered-netty-websockets_3
- unfiltered-jetty_3
- unfiltered-netty-server_3
- unfiltered-uploads_3
- unfiltered-util_3
- unfiltered-specs2_3
- unfiltered-scalatest_3
- unfiltered-json4s_3
Build Tools
Configuring sbt projects
When using sbt with binary dependencies it’s best to have the Scala version automatically appended so it will always match your project’s. In an sbt project:
libraryDependencies += "ws.unfiltered" %% "unfiltered-filter" % "$version$"
Maven
For Maven, specify the full artifact name:
<dependency>
<groupId>ws.unfiltered</groupId>
<artifactId>unfiltered-filter_3</artifactId>
<version>$version$</version>
</dependency>
To use source dependencies with Maven, your best bet is to check out the project as a submodule.
Template Projects
For a new project the easiest the easiest option to apply a giter8 template for the Unfiltered backend of your choice.
- unfiltered/unfiltered.g8 for embedded Jetty
- unfiltered/unfiltered-scalate.g8 for Scalate template evaluation
- unfiltered/unfiltered-war.g8 for a servlet container
- unfiltered/unfiltered-netty.g8 for Netty
- unfiltered/unfiltered-slick.g8 using Slick for database interaction
So for example:
g8 unfiltered/unfiltered-netty --name=justplayin
cd justplayin
sbt # *or whatever your command is
> run