diff --git a/src/main/java/org/dependencytrack/plugin/PluginInitializer.java b/src/main/java/org/dependencytrack/plugin/PluginInitializer.java index 285fe2089..5449f8f31 100644 --- a/src/main/java/org/dependencytrack/plugin/PluginInitializer.java +++ b/src/main/java/org/dependencytrack/plugin/PluginInitializer.java @@ -18,7 +18,10 @@ */ package org.dependencytrack.plugin; +import alpine.Config; import alpine.common.logging.Logger; +import org.dependencytrack.common.ConfigKey; + import jakarta.servlet.ServletContextEvent; import jakarta.servlet.ServletContextListener; @@ -33,6 +36,12 @@ public class PluginInitializer implements ServletContextListener { @Override public void contextInitialized(final ServletContextEvent event) { + if (Config.getInstance().getPropertyAsBoolean(ConfigKey.INIT_AND_EXIT)) { + LOGGER.debug("Not loading plugins because %s is enabled" + .formatted(ConfigKey.INIT_AND_EXIT.getPropertyName())); + return; + } + LOGGER.info("Loading plugins"); pluginManager.loadPlugins(); }