From 7d045578409ef2a65ced46a11ecd05b372f41a67 Mon Sep 17 00:00:00 2001 From: Michael Ruocco Date: Mon, 3 Dec 2018 06:34:38 +0000 Subject: [PATCH] Adds ability to configure plugin directory (#256) --- pf4j/src/main/java/org/pf4j/DefaultPluginManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java b/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java index 01f0f28..c1a695f 100644 --- a/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java +++ b/pf4j/src/main/java/org/pf4j/DefaultPluginManager.java @@ -21,6 +21,7 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.nio.file.Path; +import java.nio.file.Paths; /** * Default implementation of the {@link PluginManager} interface. @@ -78,7 +79,9 @@ public class DefaultPluginManager extends AbstractPluginManager { @Override protected PluginStatusProvider createPluginStatusProvider() { - return new DefaultPluginStatusProvider(getPluginsRoot()); + String configDir = System.getProperty("pf4j.pluginsConfigDir"); + Path configPath = configDir != null ? Paths.get(configDir) : getPluginsRoot(); + return new DefaultPluginStatusProvider(configPath); } @Override