From 4eeaf8ab558da4a6974e4cb5deccc57c32d620f9 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Tue, 12 Mar 2019 20:28:47 +0200 Subject: [PATCH] Resolve #294 --- .../main/java/org/pf4j/DefaultPluginManager.java | 8 ++++---- pf4j/src/test/java/org/pf4j/LoadPluginsTest.java | 14 +++++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java b/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java index 96a4104..7e90388 100644 --- a/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java +++ b/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java @@ -89,15 +89,15 @@ public class DefaultPluginManager extends AbstractPluginManager { @Override protected PluginRepository createPluginRepository() { return new CompoundPluginRepository() - .add(new DefaultPluginRepository(getPluginsRoot(), isDevelopment())) - .add(new JarPluginRepository(getPluginsRoot())); + .add(new JarPluginRepository(getPluginsRoot())) + .add(new DefaultPluginRepository(getPluginsRoot(), isDevelopment())); } @Override protected PluginLoader createPluginLoader() { return new CompoundPluginLoader() - .add(new DefaultPluginLoader(this, pluginClasspath)) - .add(new JarPluginLoader(this)); + .add(new JarPluginLoader(this)) + .add(new DefaultPluginLoader(this, pluginClasspath)); } @Override diff --git a/pf4j/src/test/java/org/pf4j/LoadPluginsTest.java b/pf4j/src/test/java/org/pf4j/LoadPluginsTest.java index c2917e8..46980bc 100644 --- a/pf4j/src/test/java/org/pf4j/LoadPluginsTest.java +++ b/pf4j/src/test/java/org/pf4j/LoadPluginsTest.java @@ -45,7 +45,19 @@ public class LoadPluginsTest { @Before public void setUp() { - pluginManager = new DefaultPluginManager(pluginsFolder.getRoot().toPath()); + pluginManager = new DefaultPluginManager(pluginsFolder.getRoot().toPath()) { + + @Override + protected PluginRepository createPluginRepository() { + return new DefaultPluginRepository(getPluginsRoot(), isDevelopment()); + } + + @Override + protected PluginLoader createPluginLoader() { + return new DefaultPluginLoader(this, pluginClasspath); + } + + }; } @Test