Skip to main content

Generate Project

The cleanArchitecture | ca task will generate a clean architecture structure in your project.

Caution: If you run this task on an existing project it will replace generated root files such as settings.gradle, build.gradle, and gradle.properties.

ParameterDescriptionUsageDefault Value
packageYou can specify the main or default package of your project--package=<desired.base.package>co.com.bancolombia
typeDefine if project shoud be created around reactive or imperative aproach--type=<imperative or reactive>reactive
nameSets projects name--name=<Project name>cleanArchitecture
lombokSpecify if you want to use this plugin--lombok=<true or false>true
metricsSpecify if you want to enable this feature with micrometer--metrics=<true or false>true
mutationDeclare Pitest in the root plugins block for mutation testing--mutation=<true or false>true
otelEnable OpenTelemetry Java agent setup for app-service via cleanPlugin--otel=<true or false>false
java-versionSets Java version--java-version=<17, 21 or 25>25

Examples:

gradle cleanArchitecture --package=co.com.bancolombia --type=reactive --name=NameProject --lombok=true

Short form

gradle ca --package=co.com.bancolombia --type=reactive --name=NameProject --lombok=true

The generated structure will look like this for java:

πŸ“¦NameProject
┣ πŸ“‚applications
┃ β”— πŸ“‚app-service
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ ┣ πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ ┣ πŸ“‚config
┃ ┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œ[configs and beans]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“œMainApplication.java
┃ ┃ ┃ ┃ β”— πŸ“‚resources
┃ ┃ ┃ ┃ ┃ ┣ πŸ“œ[properties]
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ β”— πŸ“œbuild.gradle
┣ πŸ“‚deployment
┃ ┣ πŸ“œ[Dockerfile, Pipelines as a code]
┣ πŸ“‚domain
┃ ┣ πŸ“‚model
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ β”— πŸ“œbuild.gradle
┃ β”— πŸ“‚usecase
┃ ┃ ┣ πŸ“‚src
┃ ┃ ┃ ┣ πŸ“‚main
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ β”— πŸ“‚test
┃ ┃ ┃ ┃ β”— πŸ“‚java
┃ ┃ ┃ ┃ ┃ β”— πŸ“‚[package]
┃ ┃ ┃ ┃ ┃ ┃ β”— πŸ“‚usecase
┃ ┃ β”— πŸ“œbuild.gradle
┣ πŸ“‚infrastructure
┃ ┣ πŸ“‚driven-adapters
┃ ┣ πŸ“‚entry-points
┃ β”— πŸ“‚helpers
┣ πŸ“œ.gitignore
┣ πŸ“œbuild.gradle
┣ πŸ“œgradle.properties
┣ πŸ“œlombok.config
┣ πŸ“œREADME.md
β”— πŸ“œsettings.gradle

The generated Settings convention plugin discovers modules with a build.gradle under applications, domain, and infrastructure; settings.gradle does not need static module includes. The v5 structure does not generate main.gradle. The mutation option controls whether the Pitest plugin is declared in the root plugins block; it is not written to gradle.properties. The otel option adds a cleanPlugin { otel = true } block to the root build.gradle when enabled; OpenTelemetry agent wiring for app-service is applied by the root convention plugin.