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(); context = sce.getServletContext();
PluginIndex index = readCorePluginIndex(context);
File pluginDirectory = getPluginDirectory(); File pluginDirectory = getPluginDirectory();
try try
{ {
extractCorePlugins(context, pluginDirectory, index); if (!isCorePluginExtractionDisabled()) {
extractCorePlugins(context, pluginDirectory);
} else {
logger.info("core plugin extraction is disabled");
}
ClassLoader cl = ClassLoader cl =
ClassLoaders.getContextClassLoader(BootstrapContextListener.class); 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. * Restart the whole webapp context.
* *
@@ -269,17 +275,15 @@ public class BootstrapContextListener implements ServletContextListener
* *
* @param context * @param context
* @param pluginDirectory * @param pluginDirectory
* @param lines
* @param index
* *
* @throws IOException * @throws IOException
*/ */
private void extractCorePlugins(ServletContext context, File pluginDirectory, private void extractCorePlugins(ServletContext context, File pluginDirectory) throws IOException
PluginIndex index)
throws IOException
{ {
IOUtil.mkdirs(pluginDirectory); IOUtil.mkdirs(pluginDirectory);
PluginIndex index = readCorePluginIndex(context);
for (PluginIndexEntry entry : index) for (PluginIndexEntry entry : index)
{ {
extractCorePlugin(context, pluginDirectory, entry); extractCorePlugin(context, pluginDirectory, entry);