#!/usr/bin/env bash # Facts that a test cannot observe, read straight out of the jars on the classpath. # 12-configuration-metadata.txt every spring.messages.* and spring.web.locale* property, with type and default set -euo pipefail cd "$(dirname "$0")/.." mkdir -p output target mvn -B -q dependency:build-classpath -Dmdep.outputFile=target/classpath.txt >/dev/null { echo "# spring.messages.* and spring.web.locale* in the configuration metadata shipped with Spring Boot 4.1.1" echo for jar in $(tr ':' '\n' < target/classpath.txt | grep -E 'spring-boot-autoconfigure-'); do echo "jar: $(basename "$jar")" echo unzip -p "$jar" META-INF/spring-configuration-metadata.json | python3 -c ' import json, sys for p in sorted(json.load(sys.stdin)["properties"], key=lambda p: p["name"]): if p["name"].startswith(("spring.messages.", "spring.web.locale")): print("%s\n type: %s\n default: %s" % (p["name"], p.get("type"), json.dumps(p["defaultValue"]) if "defaultValue" in p else "(none)")) ' done } > output/12-configuration-metadata.txt cat output/12-configuration-metadata.txt