From b8e5eeb271cc9b783916083a085c0d1cd7efdb18 Mon Sep 17 00:00:00 2001 From: "@C" Date: Wed, 27 Jul 2022 07:24:36 +0000 Subject: [PATCH] =?UTF-8?q?update=20yudao-server/src/test/java/cn/iocoder/?= =?UTF-8?q?yudao/ProjectReactor.java.=20=E8=A7=A3=E5=86=B3=20=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E6=94=B9=E5=8C=85=20=E5=8F=AF=E8=83=BD=E5=8F=91?= =?UTF-8?q?=E7=94=9F=E7=9A=84=E7=9B=AE=E5=BD=95=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/cn/iocoder/yudao/ProjectReactor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java index e3b8c11c8..2d0861f1b 100644 --- a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java +++ b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java @@ -53,6 +53,11 @@ public class ProjectReactor { log.info("[main][新项目目录检测 ({})已存在,请更改新的目录,程序退出]", projectBaseDirNew); return; } + //如果新目录中存在 PACKAGE_NAME, ARTIFACT_ID 等关键字,路径会被替换,导致生成的文件不在预期目录 + if(StrUtil.containsAny(projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID, StrUtil.upperFirst(ARTIFACT_ID))) { + log.info("[main][新项目目录检测 ({}) 存在冲突名称「{}」或者「{}」,请更改新的目录,程序退出]", projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID); + return; + } log.info("[main][完成新项目目录检测,新项目路径地址 ({})]", projectBaseDirNew); // 获得需要复制的文件 log.info("[main][开始获得需要重写的文件,预计需要 10-20 秒]");