This command-line tool helps you quickly bootstrap new Spring Boot projects and generate standard entities with associated layers such as DTOs, Mappers, Controllers, Services, Repositories, and database migrations.
- Interactive or argument-based project generation.
- Automatic download and setup of Spring Boot starter projects.
- Generates fully wired entity classes including:
- Java Entity
- DTO
- Mapper
- Controller
- Service
- Repository
- SQL migration script
- Generates a
builder.propertiesfile to store project configuration.
- Java 21+
- Maven
Clone the repository and run:
mvn clean packageThis will generate a file like target/springboot-builder.jar
Run in interactive mode:
java -jar target/springboot-builder.jar start-springbootOr with arguments:
java -jar target/springboot-builder.jar start-springboot 3.4.5 21 demo com.example demo demo com.example.demo web,data-jpa,postgresql,lombok,validation ./ localhost 5432 postgres public dbuser dbpasswordInteractive mode:
java -jar target/springboot-builder.jar addOr via command-line arguments:
java -jar target/springboot-builder.jar add Entity fieldName:FieldTypeExample:
java -jar target/springboot-builder.jar add Company name:String
java -jar target/springboot-builder.jar add Branch name:String company:Company foundingDate:LocalDateThis will generate:
- Entities:
Company.javaandBranch.java - DTOs:
CompanyDTO.javaandBranchDTO.java - Mappers:
CompanyMapper.javaandBranchMapper.java - Services:
CompanyService.javaandBranch.java - Controllers:
CompanyController.javaandBranch.java - Flyway migration script:
V__x__create_{company}.sqlandV__x+1__create_{branch}.sql
xis the next version based on existing migrations
Notes:
- Add
*to indicate a required field:name:String* - For enums, list the enum values inside
< >:status:Status<ACTIVE, INACTIVE, SUSPENDED>
After creating the project, a builder.properties file is generated to define paths for each component (entities, controllers, services, etc.). This file is used by the entity generator to locate and organize the source code.
Example:
builder.path=./demo
builder.package=com.example.demo
builder.entitypath=/entity
builder.controllerpath=/controller
builder.servicepath=/service
builder.repositorypath=/repository
builder.dtopath=/dto
builder.mapperpath=/mapper
builder.enumpath=/enums
builder.migrationpath=/src/main/resources/db/migration- This tool is ideal for backend developers who prefer working from the terminal.
- The SQL script is generated based on the entity definition and placed under the Flyway migrations folder.
This project is open source and contributions are welcome. Feel free to fork, copy, or submit pull requests.