diff --git a/src/test/java/CodeGenerator.java b/src/test/java/CodeGenerator.java index b335184..57b997e 100644 --- a/src/test/java/CodeGenerator.java +++ b/src/test/java/CodeGenerator.java @@ -22,10 +22,10 @@ public class CodeGenerator { private static final String JDBC_DIVER_CLASS_NAME = "com.mysql.jdbc.Driver"; private static final String PROJECT_PATH = System.getProperty("user.dir");//项目在硬盘上的基础路径 - private static final String TEMPLATE_FILE_PATH = PROJECT_PATH + "\\src\\test\\resources\\generator\\template";//模板位置 + private static final String TEMPLATE_FILE_PATH = PROJECT_PATH + "/src/test/resources/generator/template";//模板位置 - private static final String JAVA_PATH = "\\src\\main\\java"; //java文件路径 - private static final String RESOURCES_PATH = "\\src\\main\\resources";//资源文件路径 + private static final String JAVA_PATH = "/src/main/java"; //java文件路径 + private static final String RESOURCES_PATH = "/src/main/resources";//资源文件路径 private static final String PACKAGE_PATH_SERVICE = packageConvertPath(SERVICE_PACKAGE);//生成的Service存放路径 private static final String PACKAGE_PATH_SERVICE_IMPL = packageConvertPath(SERVICE_IMPL_PACKAGE);//生成的Service实现存放路径 @@ -214,6 +214,6 @@ public class CodeGenerator { } private static String packageConvertPath(String packageName) { - return String.format("\\%s\\", packageName.contains(".") ? packageName.replaceAll("\\.", "\\\\") : packageName); + return String.format("/%s/", packageName.contains(".") ? packageName.replaceAll("\\.", "/") : packageName); } }