Sample gradle project
Created from command line to showcase how a simple gradle project looks like.
bash
mkdir project-008-sample-gradle
cd project-008-sample-gradle
echo "no"| gradle init \
--type kotlin-application \
--dsl kotlin \
--test-framework kotlintest \
--package project008 \
--project-name project-008-sample-gradle \
--no-split-project \
--java-version 17Requirements
- java 17
- gradle 8.6
It does not care about your kotlin compiler available at command line. Kotlin is provisioned as a dependency and plugin for now on.
How to build
bash
gradle build
# or `gradle app:build` # or even `cd app ; gradle build`How to run
bash
gradle app:runHow to test
bash
gradle testNoteworthy
- The project can be simpler, much similar to the maven structure
- Gradle originally used groovy as dsl language for the
build.gradlefile. It supports kotlin inbuild.gradle.ktsfile nowadays. - Gradle's application plugin creates distributions instead of one huge executable jar file, like maven assembly plugin does. Both are valid ways to distribute software in the jvm ecosystem.