Skip to content

Commit

Permalink
修正mac下代码生成路径问题
Browse files Browse the repository at this point in the history
  • Loading branch information
shuzheng authored Mar 21, 2018
1 parent 329124f commit 145c97c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static void generator(
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("/", "");
Expand All @@ -65,7 +66,6 @@ public static void generator(
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 + "_%';";
Expand Down

0 comments on commit 145c97c

Please sign in to comment.