Files
spring-boot-demo/resttemplate-to-restclient/scripts/probe-properties.sh
T

24 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Reads the HTTP-client properties from spring-configuration-metadata.json inside the published
# spring-boot-http-client jars: the plural spring.http.clients.* keys and the deprecated singular ones.
set -u
cd "$(dirname "$0")/.."
OUT=output/23-http-client-properties.txt
{
echo "# 23-http-client-properties (spring-configuration-metadata.json, spring-boot-http-client jars)"
for v in 4.1.3 4.2.0; do
echo
echo "Spring Boot $v"
unzip -p "$HOME/.m2/repository/org/springframework/boot/spring-boot-http-client/$v/spring-boot-http-client-$v.jar" META-INF/spring-configuration-metadata.json \
| python3 -c "
import json,sys
for p in json.load(sys.stdin)['properties']:
n=p['name']
if n in ('spring.http.clients.connect-timeout','spring.http.clients.read-timeout','spring.http.client.connect-timeout','spring.http.client.read-timeout'):
d=p.get('deprecation')
print(' %-40s %s' % (n, 'DEPRECATED' + (' -> ' + d['replacement'] if d and 'replacement' in d else '') if d else 'current'))
"
done
} > "$OUT"
cat "$OUT"