中文 | English
Generate code for a Spring Boot project.
(This is a project based on mybatis-plus generator.)
-
Gradle
-
Add repository
maven { url "https://killerjmc.github.io/code-maker/repo" } maven { url "https://killerjmc.github.io/jmc-utils/repo" }
-
Add dependency
implementation "com.jmc:code-maker:latestVersion"
-
-
Maven
-
Add repository
<repository> <id>jmc-code-maker-repo</id> <url>https://killerjmc.github.io/code-maker/repo</url> </repository>
-
Add dependency
<dependency> <groupId>com.jmc</groupId> <artifactId>code-maker</artifactId> <version>latest-version</version> </dependency>
-
- Create a new Spring Boot project.
- Add dependency for this module.
- Add spring.datasource config into application.properties or application.yml
- Write @CodeMaker on the application class.
- Launch the application.
- Generate multi-layered architecture (pojo, dao, service, controller).
- Clean the useless files of the project.
- Inject a yml template for the project.
- Inject dependencies for the project.
- Delete itself silently after above operations.
You can specify following properties in @CodeMaker
-
Add persistenceFramework arg to specify persistence framwork (JPA or MyBatis Plus).
-
Add include arg to include tables.
-
Add include arg to exclude tables.
-
Add tablePrefix arg to specify the table prefixes, these prefixes will not join the class name of Java Bean corresponding to them.
-
Add autowired arg to specify whether to add the dependencies between components and their parents.
-
Add injectYml arg to inject application.yml template.