docs / reference/configurationspring-cli

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 ​

json
{
  "$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 ​

FieldRequirementMeaning
$schemaOptional stringURL of the published JSON Schema for editor validation and completion.
cliVersionOptional non-empty string; defaults to the current CLI versionVersion of spring-cli that wrote the config.
project.nameRequired non-empty stringProject directory name; cannot contain path separators.
project.groupIdRequired non-empty stringMaven group ID.
project.artifactIdRequired non-empty stringMaven artifact ID.
project.basePackageRequired Java package nameBase package used for generated Java classes.
project.javaVersionRequired: 21, 25, or 26Java version selected for the project.
project.buildToolRequired: mavenBuild tool used by generated projects.
project.springBootVersionOptional non-empty string; defaults to 4.1.1Spring Boot version.
project.schemaFileOptional project-relative path; defaults to schema.jsonEntity-definition file used by spring-cli schema apply.
architecture.typeRequired: monolithArchitecture strategy.
architecture.styleOptional: package-by-layer; defaults to this valuePackage organization for the monolith.
modulesOptional 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.