mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
introduce scm version to be sure the plugin is for the correct scm-manager major version
This commit is contained in:
@@ -52,6 +52,9 @@ import java.util.Set;
|
||||
public final class PluginTree
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
private static final int SCM_VERSION = 2;
|
||||
|
||||
/**
|
||||
* the logger for PluginTree
|
||||
*/
|
||||
@@ -84,6 +87,19 @@ public final class PluginTree
|
||||
for (ExplodedSmp smp : smpOrdered)
|
||||
{
|
||||
Plugin plugin = smp.getPlugin();
|
||||
|
||||
if (plugin.getScmVersion() != SCM_VERSION)
|
||||
{
|
||||
//J-
|
||||
throw new PluginException(
|
||||
String.format(
|
||||
"scm version %s of plugin %s does not match, required is version %s",
|
||||
plugin.getScmVersion(), plugin.getInformation().getId(), SCM_VERSION
|
||||
)
|
||||
);
|
||||
//J+
|
||||
}
|
||||
|
||||
PluginCondition condition = plugin.getCondition();
|
||||
|
||||
if ((condition == null) || condition.isSupported())
|
||||
@@ -202,7 +218,6 @@ public final class PluginTree
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
Reference in New Issue
Block a user