The best way of getting started is using the jooby console. It is a small application that generates
Jooby projects very quickly.
Features
-
Maven or Gradle build
-
Java or Kotlin application
-
Script or MVC routes
-
Jetty, Netty or Undertow application
-
Uber/Fat jar or Stork native launcher
-
Dockerfile
To install the console:
-
Download jooby-cli.zip
-
Unzip
jooby-cli.zipin your user home directory (or any other directory you prefer to) -
Find the native launchers in the
bindirectory
|
Tip
|
You might want to add the native launcher |
|
Note
|
To simplify documentation we use |
jooby set -w ~/SourceAll code will be saved inside the ~/Source directory.
Workspace directory is ready!
Now type jooby hit ENTER.
After prompt type help create:
jooby> help create
Missing required parameter: <name>
Usage: jooby create [-dgikms] [--server=<server>] <name>
Creates a new application
<name> Application name or coordinates (groupId:artifactId:
version)
-d, --docker Generates a Dockerfile
-g, --gradle Generates a Gradle project
-i Start interactive mode
-k, --kotlin Generates a Kotlin application
-m, --mvc Generates a MVC application
-s, --stork Add Stork Maven plugin to build (Maven only)
--server=<server> Choose one of the available servers: jetty, netty or
undertow
jooby>The create command generates a Jooby application. Some examples:
jooby> create myappjooby> create myapp --kotlinjooby> create myapp --gradlejooby> create myapp --gradle --kotlinMaven and Java are the default options but you can easily override those with -g -k or -gk (order doesn’t matter).
Along with the build and language the create command adds two test classes: UnitTest and IntegrationTest.
Passing the -m or --mvc generates a MVC application:
jooby> create myapp --mvcThe --server option, allow you to choose between: (J)etty, (N)etty or (U)ndertow:
jooby> create myapp --server undertowMaven/Gradle configuration generates an uber/fat jar at package time. Maven builds supports
generation of Stork launchers.
jooby> create myapp --storkThere is a -d or --docker option which generates a Dockerfile
jooby> create myapp --dockerThe default package in all these examples is set to app, to get fully control of groupId, package, version, etc… Use the interactive mode:
jooby> create myapp -i