Gradle Initializer provides a web-based service for generating quickstart Gradle projects. The application provides two different interfaces: a web-based UI and an endpoint for generating projects via curl
. Under the covers, Gradle Initializer uses the Tooling API to invoke the functionality of the Build Init plugin. A quickstart project is bundled and downloaded as ZIP or TAR file.
Using the web UI
The web user interface is available by opening the URL https://gradle-initializr.cleverapps.io/ in the browser of your choice. Simply select the options for your target project and press the "Generate" button to download the archive containing the project files.
Using curl
Gradle Initializer can generate and download projects from the terminal with the help of the curl
command. By default, the generated type is a plain Gradle project using the latest, packaged version of the Gradle Wrapper.
$ curl https://gradle-initializr.cleverapps.io/starter.zip -o starter.zip $ curl https://gradle-initializr.cleverapps.io/starter.tgz -o starter.tar.gz
Additionally, the following parameters can be specified.
Parameter | Description |
---|---|
|
The type of project to generate |
|
The name of the project to generate |
|
The package of the project to generate (only applies to JVM projects) |
|
The DSL to use for the generate project |
|
The Gradle version used for the Wrapper |
|
The test framework used for some of the project types |
Specifying the project type
To generate a specific project type add the type
parameter to the command. The following example generates a Java library project with the test framework TestNG:
$ curl https://gradle-initializr.cleverapps.io/starter.zip -d type=java-library -d testFramework=testng -o starter.zip
The table below presents the available project types by providing the parameter type
. The parameter is mandatory.
Value | Description |
---|---|
|
The most-basic Gradle project |
|
A C++ application project |
|
A C++ library project |
|
A Java application project |
|
A Java library project |
|
A Gradle plugin project in Java |
|
A Groovy application project |
|
A Groovy library project |
|
A Gradle plugin project in Groovy |
|
A Kotlin application project |
|
A Kotlin library project |
|
A Gradle plugin project in Kotlin |
|
A Scala library project |
Specifying the project DSL
The generated project can used two different DSLs starting with Gradle version 4.5. Use the parameter dsl
to set the DSL.
Value | Description |
---|---|
|
The project is generated with the Groovy DSL |
|
The project is generated with the Kotlin DSL |
Specifying the Wrapper version
The generated project provides a Gradle Wrapper with a specific version. The version can be provided with the parameter gradleVersion
. The minimum supported version of the Gradle Wrapper is 4.4.
Specifying the test framework
The following test frameworks can be selected for the project types java-application
and java-library
by providing the parameter testFramework
. The parameter is optional. The test framework JUnit 4 is used if the parameter isn’t provided.
Value | Description |
---|---|
|
|
|
|
|