未验证 提交 145c97c5 编写于 作者: shuzheng5201314's avatar shuzheng5201314 提交者: GitHub

修正mac下代码生成路径问题

上级 329124f8
......@@ -51,6 +51,7 @@ public class MybatisGeneratorUtil {
Map<String, String> lastInsertIdTables) throws Exception{
String os = System.getProperty("os.name");
String targetProject = module + "/" + module + "-dao";
String basePath = MybatisGeneratorUtil.class.getResource("/").getPath().replace("/target/classes/", "").replace(targetProject, "");
if (os.toLowerCase().startsWith("win")) {
generatorConfig_vm = MybatisGeneratorUtil.class.getResource(generatorConfig_vm).getPath().replaceFirst("/", "");
......@@ -65,7 +66,6 @@ public class MybatisGeneratorUtil {
serviceImpl_vm = MybatisGeneratorUtil.class.getResource(serviceImpl_vm).getPath();
}
String targetProject = module + "/" + module + "-dao";
String generatorConfigXml = MybatisGeneratorUtil.class.getResource("/").getPath().replace("/target/classes/", "") + "/src/main/resources/generatorConfig.xml";
targetProject = basePath + targetProject;
String sql = "SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = '" + database + "' AND table_name LIKE '" + tablePrefix + "_%';";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册