From 4d8ca652e27ed927b12b0f69e5324391e09d19e2 Mon Sep 17 00:00:00 2001 From: yaoxuwan Date: Mon, 26 May 2025 11:37:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=A4=B1=E8=B4=A5=EF=BC=8C=E6=89=BE=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/com/tencent/devops/plugin/core/PluginLoader.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/devops-boot-project/devops-boot-core/devops-plugin/devops-plugin-core/src/main/kotlin/com/tencent/devops/plugin/core/PluginLoader.kt b/devops-boot-project/devops-boot-core/devops-plugin/devops-plugin-core/src/main/kotlin/com/tencent/devops/plugin/core/PluginLoader.kt index 011ad74..49a16a8 100644 --- a/devops-boot-project/devops-boot-core/devops-plugin/devops-plugin-core/src/main/kotlin/com/tencent/devops/plugin/core/PluginLoader.kt +++ b/devops-boot-project/devops-boot-core/devops-plugin/devops-plugin-core/src/main/kotlin/com/tencent/devops/plugin/core/PluginLoader.kt @@ -4,8 +4,8 @@ import com.tencent.devops.plugin.api.EXTENSION_LOCATION import com.tencent.devops.plugin.api.ExtensionType import com.tencent.devops.plugin.api.PluginInfo import com.tencent.devops.plugin.api.PluginMetadata -import org.springframework.boot.loader.launch.LaunchedClassLoader import org.springframework.boot.loader.launch.Archive +import org.springframework.boot.loader.launch.LaunchedClassLoader import java.io.IOException import java.net.URL import java.nio.file.Files @@ -115,9 +115,10 @@ class PluginLoader( } private fun createClassloader(pluginPath: Path): ClassLoader { - val jarArchive = Archive.create(pluginPath.toFile()) + val pluginFile = pluginPath.toFile() + val jarArchive = Archive.create(pluginFile) val archives = jarArchive.getClassPathUrls(includeFilter, directorySearchFilter) - val urls = mutableListOf() + val urls = mutableListOf(pluginFile.toURI().toURL()) archives.forEach { urls.add(it) }