Skip to content

Commit 3c88c5d

Browse files
committed
修复Codegen生成实体时,不配置codegen.setting.json文件报错问题
https://gitee.com/minbox-projects/api-boot/issues/I13NJP
1 parent 1e09c83 commit 3c88c5d

File tree

1 file changed

+6
-5
lines changed
  • api-boot-project/api-boot-maven-plugins/api-boot-mybatis-enhance-maven-codegen/src/main/java/org/minbox/framework/api/boot/maven/plugin/mybatis/enhance/codegen

1 file changed

+6
-5
lines changed

api-boot-project/api-boot-maven-plugins/api-boot-mybatis-enhance-maven-codegen/src/main/java/org/minbox/framework/api/boot/maven/plugin/mybatis/enhance/codegen/ApiBootMybatisEnhanceCodegen.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ public void execute() throws MojoExecutionException, MojoFailureException {
171171
// execute the builders created
172172
// ClassBuilder implementation classes can be added
173173
Class<? extends ClassBuilder>[] builders = new Class[]{
174-
EntityClassBuilder.class,
175-
DynamicEntityClassBuilder.class
174+
EntityClassBuilder.class,
175+
DynamicEntityClassBuilder.class
176176
};
177177

178178
// ignore table prefix
@@ -233,15 +233,16 @@ public void execute() throws MojoExecutionException, MojoFailureException {
233233

234234
/**
235235
* load codegen.setting.json parse to CodegenSetting entity
236+
* read codegen.setting.json content
236237
*/
237238
private String loadCodegenSetting() {
238239
try {
239240
// formatter codegen.setting.json path
240241
String settingJsonPath = String.format("%s%s", EnhanceCodegenConstant.CLASSES_PATH.replace(EnhanceCodegenConstant.POINT, File.separator), EnhanceCodegenConstant.SETTING_JSON);
241-
242-
// read codegen.setting.json content
243242
File file = new File(projectBaseDir + settingJsonPath);
244-
return FileUtils.fileRead(file);
243+
if (file.exists()) {
244+
return FileUtils.fileRead(file);
245+
}
245246
} catch (Exception e) {
246247
getLog().error(e);
247248
}

0 commit comments

Comments
 (0)