Project configuration
spring-cli create writes spring-cli.json at the project root. Commands that operate on a project search upward from the current directory for this file, then validate it before proceeding.
Example
{
"$schema": "https://raw.githubusercontent.com/josecamporivas/springboot-cli/main/schema.json",
"cliVersion": "1.0.0",
"project": {
"name": "catalog",
"groupId": "com.example",
"artifactId": "catalog",
"basePackage": "com.example.catalog",
"javaVersion": 21,
"buildTool": "maven",
"springBootVersion": "4.1.1",
"schemaFile": "schema.json"
},
"architecture": {
"type": "monolith",
"style": "package-by-layer"
},
"modules": []
}Fields
| Field | Requirement | Meaning |
|---|---|---|
$schema | Optional string | URL of the published JSON Schema for editor validation and completion. |
cliVersion | Optional non-empty string; defaults to the current CLI version | Version of spring-cli that wrote the config. |
project.name | Required non-empty string | Project directory name; cannot contain path separators. |
project.groupId | Required non-empty string | Maven group ID. |
project.artifactId | Required non-empty string | Maven artifact ID. |
project.basePackage | Required Java package name | Base package used for generated Java classes. |
project.javaVersion | Required: 21, 25, or 26 | Java version selected for the project. |
project.buildTool | Required: maven | Build tool used by generated projects. |
project.springBootVersion | Optional non-empty string; defaults to 4.1.1 | Spring Boot version. |
project.schemaFile | Optional project-relative path; defaults to schema.json | Entity-definition file used by spring-cli schema apply. |
architecture.type | Required: monolith | Architecture strategy. |
architecture.style | Optional: package-by-layer; defaults to this value | Package organization for the monolith. |
modules | Optional array of strings; defaults to [] | Not used by the currently supported monolith architecture. |
Unknown fields are rejected. String fields are trimmed and must satisfy their field-specific rules. The CLI validates the file when a command loads the project config; there is no separate spring-cli config validate command.
Entity schema path
project.schemaFile is resolved relative to the project root. Absolute paths and paths that traverse above the project root are rejected. Set this property to a different relative filename if you want to keep entity definitions somewhere other than the default schema.json.
The published JSON Schema and project entity schema
The URL in $schema points to the repository's published config JSON Schema, which describes the shape of spring-cli.json for editors. Separately, the generated project's project.schemaFile points to a local entity-definition file consumed by spring-cli schema apply. The two files have different formats and purposes despite sharing the default filename schema.json in separate locations.
Current architecture support
The config schema currently accepts Maven projects using the monolith architecture and package-by-layer style. It does not configure Gradle, microservices, or modular-monolith projects. The modules array is not used by the currently supported monolith architecture.