2

Here is a question wich offer a solution to print all properties. But in fact it prints all properties from .properties files in application sources, system and environment properties. But it ignore all properties from

  • additional-spring-configuration-metadata.json
  • spring-configuration-metadata.json
  • spring-autoconfigure-metadata.properties
  • and others from json or properties in project dependecies
  • any properties which is considered as present in org.springframework.boot.autoconfigure.condition.ConditionalOnProperty annotation, with matchIfMissing key word, like that @ConditionalOnProperty(prefix = "spring.data.solr.repositories", name = "enabled", havingValue = "true", matchIfMissing = true)

Even I can not find any variable inside Environment env which points to any of these properties.

So is there a way to print all properties both from current application sources and from imported dependencies/jars, especially which are generated via by annotatios?

Patrick
  • 12,336
  • 15
  • 73
  • 115
Cherry
  • 31,309
  • 66
  • 224
  • 364
  • Those `metadata` files don't contain properties those are only for the IDE to provide information on the well known properties. The `@Conditional` rule you point out also doesn't add anything as a property which should be clear by `matchIfMissing` if it isn't available the rule matches, but this doesn't mean the property is available. – M. Deinum May 29 '17 at 04:58
  • "Those metadata files don't contain properties" but they define default values for some properties, so this value is used somewhere I think. – Cherry May 29 '17 at 05:28
  • No they don't. It is only metadata for use in IDE's . The defaults are in the `@ConfigurationProperties` annotated classes. They are in those metadata files for reference. – M. Deinum May 29 '17 at 05:49
  • Do you mean that metadata files are generated from `@ConfigurationProperties` annotations? Could you please provied a proof link to that? – Cherry May 29 '17 at 06:47
  • Not sure how the spring team generates those (or if they are generated at all). But it is a fact that those aren't into play for defining properties as stated those are only for the IDE. – M. Deinum May 29 '17 at 07:02

0 Answers0