Permalink
Browse files

fix for GRAILS-9726 "Plugin resolution occasionally removes necessary…

… plugins due to similarly named inline-plugins"
  • Loading branch information...
1 parent e07b78a commit cc9c50f014e43af4c369227d8f5029a5a29b4078 @graemerocher graemerocher committed Feb 19, 2013
View
16 ...s-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginInstallEngine.groovy
@@ -217,7 +217,13 @@ class PluginInstallEngine {
* avoid errors about not being able to find the src folders AFTER
* the plugin has been uninstalled.
*/
- if(!inlinePlugins.find { it.key.endsWith(name) } ) {
+ if(!inlinePlugins.find {
+ def pluginName = it.key.toString()
+ if (pluginName.contains(':')) {
+ pluginName = pluginName.split(':')[-1]
+ }
+ return pluginName.equals(name)
+ } ) {
installPluginZipInternal name, version, zipFile, false, false, true
} else {
// Remove the plugin to prevent duplicate class compile errors with inline version.
@@ -420,7 +426,13 @@ class PluginInstallEngine {
* plugin uses "endsWith", as inline plugins can be declared with a full
* vector in settings.groovy (i.e. 'com.mycompany:my-plugin")
*/
- if(inlinePlugins.find { it.key.endsWith(name) } ) {
+ if( inlinePlugins.find {
+ def pluginName = it.key.toString()
+ if (pluginName.contains(':')) {
+ pluginName = pluginName.split(':')[-1]
+ }
+ return pluginName.equals(name)
+ } ) {
return true
}

0 comments on commit cc9c50f

Please sign in to comment.