jdaugherty commented on code in PR #15970:
URL: https://github.com/apache/grails-core/pull/15970#discussion_r3564258364
##########
grails-core/src/main/groovy/org/apache/grails/core/plugins/DefaultPluginDiscovery.java:
##########
@@ -483,12 +483,26 @@ private void attemptRegisterPlugins(List<PluginInfo>
filteredPlugins) {
/**
* Registers a plugin that is eligible to be loaded.
*
- * <p>This method skips disabled plugins, records eviction and observer
relationships, and appends the
- * plugin to the discovered load order.</p>
+ * <p>This method skips disabled plugins and plugins already registered
under the same name (a plugin
+ * class may be declared by more than one {@code
META-INF/grails-plugin.xml} descriptor on the
+ * classpath), records eviction and observer relationships, and appends
the plugin to the discovered
+ * load order.</p>
*
* @param plugin the plugin to register
*/
private void registerPlugin(PluginInfo plugin) {
+ var registeredPlugin = plugins.get(plugin.getName());
+ if (registeredPlugin != null) {
+ LOG.warn(
Review Comment:
This should throw instead of warn.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]