diff --git a/application/src/main/java/run/halo/app/plugin/PluginAutoConfiguration.java b/application/src/main/java/run/halo/app/plugin/PluginAutoConfiguration.java index bd74031438..6bf8c85a5e 100644 --- a/application/src/main/java/run/halo/app/plugin/PluginAutoConfiguration.java +++ b/application/src/main/java/run/halo/app/plugin/PluginAutoConfiguration.java @@ -10,14 +10,12 @@ import java.time.Instant; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.pf4j.ClassLoadingStrategy; import org.pf4j.CompoundPluginLoader; import org.pf4j.CompoundPluginRepository; import org.pf4j.DefaultPluginRepository; import org.pf4j.DevelopmentPluginLoader; import org.pf4j.JarPluginLoader; import org.pf4j.JarPluginRepository; -import org.pf4j.PluginClassLoader; import org.pf4j.PluginDescriptor; import org.pf4j.PluginLoader; import org.pf4j.PluginManager; @@ -111,17 +109,7 @@ protected PluginLoader createPluginLoader() { } else { return new CompoundPluginLoader() .add(createDevelopmentPluginLoader(this), this::isDevelopment) - .add(new JarPluginLoader(this) { - @Override - public ClassLoader loadPlugin(Path pluginPath, - PluginDescriptor pluginDescriptor) { - PluginClassLoader pluginClassLoader = - new PluginClassLoader(pluginManager, pluginDescriptor, - getClass().getClassLoader(), ClassLoadingStrategy.APD); - pluginClassLoader.addFile(pluginPath.toFile()); - return pluginClassLoader; - } - }); + .add(new JarPluginLoader(this)); } } @@ -156,12 +144,6 @@ protected PluginRepository createPluginRepository() { DevelopmentPluginLoader createDevelopmentPluginLoader(PluginManager pluginManager) { return new DevelopmentPluginLoader(pluginManager) { - @Override - protected PluginClassLoader createPluginClassLoader(Path pluginPath, - PluginDescriptor pluginDescriptor) { - return new PluginClassLoader(pluginManager, pluginDescriptor, - getClass().getClassLoader(), ClassLoadingStrategy.APD); - } @Override public ClassLoader loadPlugin(Path pluginPath,