-
-
Notifications
You must be signed in to change notification settings - Fork 972
Improve unresolved plugin dependency diagnostics #15995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 8.0.x
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -418,16 +418,36 @@ private void loadDelayedPlugins() { | |
| delayedLoadPlugins.add(plugin); | ||
| } else { | ||
| failedPlugins.put(plugin.getName(), plugin); | ||
| LOG.error( | ||
| "ERROR: Plugin [{}] cannot be loaded because its dependencies [{}}] cannot be resolved", | ||
| plugin.getName(), | ||
| plugin.getDependsOnNames() | ||
| ); | ||
| logUnresolvedDependencies(plugin); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private void logUnresolvedDependencies(PluginInfo plugin) { | ||
| var unresolvedDependencies = new ArrayList<String>(); | ||
| for (var name : plugin.getDependsOnNames()) { | ||
| var requiredVersion = plugin.getMetadata().getDependentVersion(name); | ||
| var dependency = findPlugin(name); | ||
| if (dependency == null) { | ||
| unresolvedDependencies.add( | ||
| "dependency [" + name + "] with required version [" + requiredVersion + "] is missing" | ||
| ); | ||
| } else if (!GrailsVersionUtils.isValidVersion(dependency.getPluginVersion(), requiredVersion)) { | ||
| unresolvedDependencies.add( | ||
| "dependency [" + name + "] has version [" + dependency.getPluginVersion() + | ||
| "] but requires [" + requiredVersion + "]" | ||
| ); | ||
| } | ||
| } | ||
| LOG.warn( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please keep this at ERROR rather than WARN. Unresolved dependencies already put the plugin in |
||
| "Grails plug-in [{}] with version [{}] cannot be loaded: {}", | ||
| plugin.getName(), | ||
| plugin.getPluginVersion(), | ||
| String.join("; ", unresolvedDependencies) | ||
| ); | ||
| } | ||
|
Comment on lines
+427
to
+460
|
||
|
|
||
| /** | ||
| * Checks whether the first plugin is dependent on the second plugin. | ||
| * | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree on this being a warning, there is a legitimate configuration issue. This should be an error message