Creating Ratpack projects with Lazybones and running them with Gradle and as standalone JAR (10 minutes)
Lazybones is a scaffolding tool to generate application skeletons for different projects, and it’s the recommended option for bootstrapping a Ratpack application.
Let’s create a Ratpack project in the current directory:
lazybones create ratpack .
After that, you can run the application with Gradle:
./gradlew run
Once you have created the app, let’s have a look at it’s content:
-
build.gradle
is the main Gradle build file. -
src/main/groovy
is the package root for your Groovy classes (as in all Gradle/Maven applications). -
src/ratpack
contains Ratpack specific artifacts. The most important one isRatpack.groovy
which contains the Ratpack DSL. If you take a look at it, you will find it similar to the script we created in the previous exercise. -
src/test/groovy
will contain your Spock tests.