introduce scm version to be sure the plugin is for the correct scm-manager major version

This commit is contained in:
Sebastian Sdorra
2014-09-13 20:07:07 +02:00
parent 557bc29c31
commit b465e4b18b
8 changed files with 69 additions and 10 deletions

View File

@@ -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 */