docs / guides/project-structurespringboot-cli

Project structure ​

springboot-cli creates a standard Maven Spring Boot project, then adds springboot-cli.json and a small set of files for its monolith architecture.

Package-by-layer layout ​

Generated Java components go into packages under the configured project.basePackage:

ComponentPackage directoryExample class
ControllercontrollerProductController.java
ServiceserviceProductService.java
RepositoryrepositoryProductRepository.java
EntitydomainProduct.java
DTOdtoProductDTO.java
ConfigurationconfigProductConfig.java
ListenerlistenerProductListener.java
ExceptionexceptionProductException.java

The initial project also contains GlobalExceptionHandler, ResourceNotFoundException, and a test that checks the layer dependency rules. Component templates are starting points: for example, generated services and repositories are empty skeletons and need application-specific behavior.

springboot-cli.json ​

The project-root config records the project name, Maven coordinates, Java and Spring Boot versions, package, architecture, and entity schema path. The $schema property enables editor assistance. See the configuration reference for every field.

Project commands search upward from the current directory for springboot-cli.json, so commands can run from the project root or a subdirectory.

Two entity-generation paths ​

  • springboot-cli add entity --name Product creates a plain Java class skeleton in the domain package.
  • springboot-cli schema apply creates JPA entity classes from a project entity definition file, including table and field annotations.

These are separate workflows. See Schema-driven entities before using the second one.