matrei commented on code in PR #16434:
URL: https://github.com/apache/grails-core/pull/16434#discussion_r4152754710
##########
grails-core/src/cli/groovy/org/apache/grails/core/cli/ConfigReportCommand.groovy:
##########
@@ -202,12 +206,26 @@ class ConfigReportCommand implements ApplicationCommand {
}
MetadataResult loadPropertyMetadata() {
- Enumeration<URL> resources =
ConfigReportCommand.classLoader.getResources('META-INF/spring-configuration-metadata.json')
+ loadPropertyMetadata(ConfigReportCommand.classLoader)
+ }
+
+ /**
+ * Loads the configuration metadata on the classpath of the given class
loader. Properties outside the Grails
+ * namespaces are only included when they are published by a Grails
plugin, so that the metadata of other
+ * libraries, such as Spring Boot, does not flood the report.
+ *
+ * @param classLoader the class loader to load the metadata from
+ * @return the properties and group descriptions
+ */
+ MetadataResult loadPropertyMetadata(ClassLoader classLoader) {
+ Set<String> pluginRoots = findPluginRoots(classLoader)
+ Enumeration<URL> resources =
classLoader.getResources(METADATA_RESOURCE)
List<ConfigPropertyMetadata> metadata = new
ArrayList<ConfigPropertyMetadata>()
Map<String, String> groupDescriptions = new LinkedHashMap<String,
String>()
JsonSlurper slurper = new JsonSlurper()
while (resources.hasMoreElements()) {
URL resource = resources.nextElement()
+ boolean pluginMetadata =
pluginRoots.contains(resourceRoot(resource, METADATA_RESOURCE))
Review Comment:
Correction to my reply above: the commit with the fix was pushed only after
this PR had been merged, so it is not in 8.0.x. I've opened #16450 with it.
--
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]