Skip to content

Commit cc9c50f

Browse files
committed
fix for GRAILS-9726 "Plugin resolution occasionally removes necessary plugins due to similarly named inline-plugins"
1 parent e07b78a commit cc9c50f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginInstallEngine.groovy

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,13 @@ class PluginInstallEngine {
217217
* avoid errors about not being able to find the src folders AFTER
218218
* the plugin has been uninstalled.
219219
*/
220-
if(!inlinePlugins.find { it.key.endsWith(name) } ) {
220+
if(!inlinePlugins.find {
221+
def pluginName = it.key.toString()
222+
if (pluginName.contains(':')) {
223+
pluginName = pluginName.split(':')[-1]
224+
}
225+
return pluginName.equals(name)
226+
} ) {
221227
installPluginZipInternal name, version, zipFile, false, false, true
222228
} else {
223229
// Remove the plugin to prevent duplicate class compile errors with inline version.
@@ -420,7 +426,13 @@ class PluginInstallEngine {
420426
* plugin uses "endsWith", as inline plugins can be declared with a full
421427
* vector in settings.groovy (i.e. 'com.mycompany:my-plugin")
422428
*/
423-
if(inlinePlugins.find { it.key.endsWith(name) } ) {
429+
if( inlinePlugins.find {
430+
def pluginName = it.key.toString()
431+
if (pluginName.contains(':')) {
432+
pluginName = pluginName.split(':')[-1]
433+
}
434+
return pluginName.equals(name)
435+
} ) {
424436
return true
425437
}
426438

0 commit comments

Comments
 (0)