From f083c5ddb63acd80503f38b238ac0705c191bd53 Mon Sep 17 00:00:00 2001 From: vfhky Date: Sun, 25 Feb 2024 14:31:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=B9=E5=99=A8=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E7=9A=84=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/jpom/build/BuildExecuteManage.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/server/src/main/java/org/dromara/jpom/build/BuildExecuteManage.java b/modules/server/src/main/java/org/dromara/jpom/build/BuildExecuteManage.java index 70fd200885..1eae0f8d7c 100644 --- a/modules/server/src/main/java/org/dromara/jpom/build/BuildExecuteManage.java +++ b/modules/server/src/main/java/org/dromara/jpom/build/BuildExecuteManage.java @@ -131,6 +131,10 @@ public static Set buildKeys() { return BUILD_MANAGE_MAP.keySet(); } + + private final static String TARGET_DIR = "target"; + + /** * 创建构建线程池 */ @@ -251,7 +255,7 @@ private String packageFile() { }; if (buildMode != null && buildMode == 1) { // 容器构建直接下载到 结果目录 - File toFile = BuildUtil.getHistoryPackageFile(buildInfoModel.getId(), buildInfoModel.getBuildId(), resultDirFileAction.getPath()); + File toFile = BuildUtil.getHistoryPackageFile(buildInfoModel.getId(), buildInfoModel.getBuildId(), TARGET_DIR); if (!FileUtil.exist(toFile)) { String format = StrUtil.format("{} 不存在,处理构建产物失败", resultDirFileAction.getPath()); logRecorder.systemError(format); @@ -589,7 +593,7 @@ private String dockerCommand() { String resultFile = FileUtil.normalize(workingDir + StrUtil.SLASH + resultDirFile); map.put("resultFile", resultFile); // 产物输出目录 - File toFile = BuildUtil.getHistoryPackageFile(buildInfoModelId, buildInfoModel.getBuildId(), resultDirFile); + File toFile = BuildUtil.getHistoryPackageFile(buildInfoModelId, buildInfoModel.getBuildId(), TARGET_DIR); map.put("resultFileOut", FileUtil.getAbsolutePath(toFile)); IPlugin plugin = PluginFactory.getPlugin(DockerInfoService.DOCKER_PLUGIN_NAME); try {