if (null != version) {
String otherVersion = versions.get(name);
if (null != otherVersion) {
if (!version.startsWith(EXPR_START)) {
if (!otherVersion.startsWith(EXPR_START) && !otherVersion.equals(version)) {
throw new GeomajasException(ExceptionCode.DEPENDENCY_CHECK_INVALID_DUPLICATE,
name, version, versions.get(name));
}
versions.put(name, version);
}
} else {
versions.put(name, version);
}
}
}
// Check dependencies
StringBuilder message = new StringBuilder();
String backendVersion = versions.get("Geomajas");
for (PluginInfo plugin : declaredPlugins.values()) {
String name = plugin.getVersion().getName();
message.append(checkVersion(name, "Geomajas back-end", plugin.getBackendVersion(), backendVersion));
List<PluginVersionInfo> dependencies = plugin.getDependencies();
if (null != dependencies) {
for (PluginVersionInfo dependency : plugin.getDependencies()) {
String depName = dependency.getName();
message.append(checkVersion(name, depName, dependency.getVersion(), versions.get(depName)));
}
}
dependencies = plugin.getOptionalDependencies();
if (null != dependencies) {
for (PluginVersionInfo dependency : dependencies) {
String depName = dependency.getName();
String availableVersion = versions.get(depName);
if (null != availableVersion) {
message.append(checkVersion(name, depName, dependency.getVersion(), versions.get(depName)));
}
}
}
}
if (message.length() > 0) {
throw new GeomajasException(ExceptionCode.DEPENDENCY_CHECK_FAILED, message.toString());
}
recorder.record(GROUP, VALUE);
}