mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
added system property to disable extraction of core plugins
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user