pluginDescriptor.setPluginClass(clazz);
String version = attributes.getValue("Plugin-Version");
- pluginDescriptor.setPluginVersion(Version.valueOf(version));
+ if (StringUtils.isNotEmpty(version)) {
+ pluginDescriptor.setPluginVersion(Version.valueOf(version));
+ }
String provider = attributes.getValue("Plugin-Provider");
pluginDescriptor.setProvider(provider);
if (StringUtils.isEmpty(pluginDescriptor.getPluginClass())) {
throw new PluginException("Plugin-Class cannot be empty");
}
+ if (pluginDescriptor.getVersion() == null) {
+ throw new PluginException("Plugin-Version cannot be empty");
+ }
}
}
pluginDescriptor.setPluginClass(clazz);
String version = properties.getProperty("plugin.version");
- pluginDescriptor.setPluginVersion(Version.valueOf(version));
+ if (StringUtils.isNotEmpty(version)) {
+ pluginDescriptor.setPluginVersion(Version.valueOf(version));
+ }
String provider = properties.getProperty("plugin.provider");
pluginDescriptor.setProvider(provider);
protected void validatePluginDescriptor(PluginDescriptor pluginDescriptor) throws PluginException {
if (StringUtils.isEmpty(pluginDescriptor.getPluginId())) {
throw new PluginException("plugin.id cannot be empty");
-
}
if (StringUtils.isEmpty(pluginDescriptor.getPluginClass())) {
throw new PluginException("plugin.class cannot be empty");
}
+ if (pluginDescriptor.getVersion() == null) {
+ throw new PluginException("plugin.version cannot be empty");
+ }
}
}