added system property to disable extraction of core plugins

This commit is contained in:
Sebastian Sdorra
2018-10-16 14:14:16 +02:00
parent 08a8b4a067
commit 41cc61277f

View File

@@ -148,13 +148,15 @@ public class BootstrapContextListener implements ServletContextListener
{
context = sce.getServletContext();
PluginIndex index = readCorePluginIndex(context);
File pluginDirectory = getPluginDirectory();
try
{
extractCorePlugins(context, pluginDirectory, index);
if (!isCorePluginExtractionDisabled()) {
extractCorePlugins(context, pluginDirectory);
} else {
logger.info("core plugin extraction is disabled");
}
ClassLoader cl =
ClassLoaders.getContextClassLoader(BootstrapContextListener.class);
@@ -181,6 +183,10 @@ public class BootstrapContextListener implements ServletContextListener
}
}
private boolean isCorePluginExtractionDisabled() {
return Boolean.getBoolean("sonia.scm.boot.disable-core-plugin-extraction");
}
/**
* Restart the whole webapp context.
*
@@ -269,17 +275,15 @@ public class BootstrapContextListener implements ServletContextListener
*
* @param context
* @param pluginDirectory
* @param lines
* @param index
*
* @throws IOException
*/
private void extractCorePlugins(ServletContext context, File pluginDirectory,
PluginIndex index)
throws IOException
private void extractCorePlugins(ServletContext context, File pluginDirectory) throws IOException
{
IOUtil.mkdirs(pluginDirectory);
PluginIndex index = readCorePluginIndex(context);
for (PluginIndexEntry entry : index)
{
extractCorePlugin(context, pluginDirectory, entry);