From 93b466505fcc282b14dfca3a03a8c850a1678d8c Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Fri, 28 Jul 2023 18:37:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20mapper=20xml=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=94=9F=E6=88=90=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mybatisflex/codegen/config/PackageConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/PackageConfig.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/PackageConfig.java index c5559542..70aa0b41 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/PackageConfig.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/PackageConfig.java @@ -218,7 +218,7 @@ public class PackageConfig { */ public String getMapperXmlPath() { if (StringUtil.isBlank(mapperXmlPath)) { - return getSourceDir().concat("/resources/mapper"); + return System.getProperty("user.dir").concat("/src/main/resources/mapper"); } return mapperXmlPath; } From 8efd7b34feca4a2f476b2ab3b57b19f52e0106a9 Mon Sep 17 00:00:00 2001 From: Suomm <1474983351@qq.com> Date: Fri, 28 Jul 2023 18:37:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95=20mapper=20xml?= =?UTF-8?q?=20=E7=94=9F=E6=88=90=E8=B7=AF=E5=BE=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/java/com/mybatisflex/codegen/test/GeneratorTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mybatis-flex-codegen/src/test/java/com/mybatisflex/codegen/test/GeneratorTest.java b/mybatis-flex-codegen/src/test/java/com/mybatisflex/codegen/test/GeneratorTest.java index 15a5e8d8..aa350c86 100644 --- a/mybatis-flex-codegen/src/test/java/com/mybatisflex/codegen/test/GeneratorTest.java +++ b/mybatis-flex-codegen/src/test/java/com/mybatisflex/codegen/test/GeneratorTest.java @@ -86,7 +86,7 @@ public class GeneratorTest { generator.generate(); } - // @Test + // @Test public void testCodeGen2() { //配置数据源 HikariDataSource dataSource = new HikariDataSource(); @@ -107,7 +107,7 @@ public class GeneratorTest { //设置生成文件目录和根包 globalConfig.getPackageConfig() .setSourceDir(System.getProperty("user.dir") + "/src/test/java") - .setMapperXmlPath(System.getProperty("user.dir") + "/src/test/java/resources/mapper") + .setMapperXmlPath(System.getProperty("user.dir") + "/src/test/resources/mapper") .setBasePackage("com.test"); //设置表前缀和只生成哪些表