You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by li...@apache.org on 2008/10/10 15:24:46 UTC
svn commit: r703450 - in /geronimo/server/trunk:
buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/
framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/
Author: linsun
Date: Fri Oct 10 06:24:46 2008
New Revision: 703450
URL: http://svn.apache.org/viewvc?rev=703450&view=rev
Log:
GERONIMO-4346 c-m-p leaves invalid plugin in plugin catalog and doesn't update plugin catalog when desp is updated
Modified:
geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UpdatePluginListMojo.java
geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
Modified: geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UpdatePluginListMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UpdatePluginListMojo.java?rev=703450&r1=703449&r2=703450&view=diff
==============================================================================
--- geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UpdatePluginListMojo.java (original)
+++ geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/UpdatePluginListMojo.java Fri Oct 10 06:24:46 2008
@@ -97,21 +97,32 @@
PluginArtifactType instance = plugin.getPluginArtifact().get(0);
Artifact id = PluginInstallerGBean.toArtifact(instance.getModuleId());
boolean foundKey = false;
- for (PluginType test : pluginList.getPlugin()) {
+ boolean foundModule = false;
+ for (Iterator<PluginType> pit = pluginList.getPlugin().iterator(); pit.hasNext();) {
+ PluginType test = pit.next();
for (Iterator<PluginArtifactType> it = test.getPluginArtifact().iterator(); it.hasNext();) {
PluginArtifactType testInstance = it.next();
Artifact testId = PluginInstallerGBean.toArtifact(testInstance.getModuleId());
if (id.equals(testId)) {
//if the module id appears anywhere, remove that instance
+ //however, this would cause plugin without plugin artifact
it.remove();
+ foundModule = true;
}
}
PluginType testKey = PluginInstallerGBean.toKey(test);
if (key.equals(testKey)) {
foundKey = true;
- //if the name, group, author, licences, url match, then add this instance to current pluginType
+ //if the name, category, author, description, pluginGroup, licence, url match, then add this instance to current pluginType
test.getPluginArtifact().add(instance);
}
+ if(!foundKey && foundModule) {
+ //remove the old plugin off pluginList if it exists as we 'll add a new one
+ //otherwise we'll leave plugin without plugin artifact on the plugin catalog.
+ if (test.getPluginArtifact().size() == 0) {
+ pit.remove();
+ }
+ }
}
if (!foundKey) {
//did not find a matching key
Modified: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java?rev=703450&r1=703449&r2=703450&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginInstallerGBean.java Fri Oct 10 06:24:46 2008
@@ -1655,6 +1655,8 @@
PluginType copy = new PluginKey();
copy.setAuthor(metadata.getAuthor());
copy.setCategory(metadata.getCategory());
+ copy.setPluginGroup(metadata.isPluginGroup() == null ? false : metadata.isPluginGroup());
+ copy.setDescription(metadata.getDescription());
copy.setName(metadata.getName());
copy.setUrl(metadata.getUrl());
copy.getLicense().addAll(metadata.getLicense());
@@ -1672,6 +1674,8 @@
if (author != null ? !author.equals(that.author) : that.author != null) return false;
if (category != null ? !category.equals(that.category) : that.category != null) return false;
+ if (description != null ? !description.equals(that.description) : that.description != null) return false;
+ if (pluginGroup != null ? pluginGroup != that.pluginGroup : that.pluginGroup != null) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (url != null ? !url.equals(that.url) : that.url != null) return false;
if ((license == null) != (that.license == null)) return false;