#!/usr/bin/env bash # Which Boot test jars does spring-boot-starter-test alone bring in? # Resolves a throwaway project with the three production starters and ONLY spring-boot-starter-test, # then lists every spring-boot jar with "test" in its name. Writes output/12-starter-test-only-jars.txt. set -euo pipefail cd "$(dirname "$0")/.." BOOT="$(sed -n '/spring-boot-starter-parent<\/artifactId>/{n;s/.*\(.*\)<\/version>.*/\1/p}' pom.xml)" TMP=target/starter-test-only rm -rf "$TMP" && mkdir -p "$TMP" cat > "$TMP/pom.xml" <4.0.0 org.springframework.bootspring-boot-starter-parent${BOOT} probestarter-test-only1 org.springframework.bootspring-boot-starter-webmvc org.springframework.bootspring-boot-starter-data-jpa org.springframework.bootspring-boot-starter-restclient org.springframework.bootspring-boot-starter-testtest POM mvn -B -q -f "$TMP/pom.xml" dependency:build-classpath -Dmdep.outputFile=cp.txt > /dev/null 2>&1 { echo "Spring Boot ${BOOT}: webmvc + data-jpa + restclient starters, and only spring-boot-starter-test for tests" echo "spring-boot jars with 'test' in the name on that classpath:" tr ':' '\n' < "$TMP/cp.txt" | sed 's#.*/##' | grep -E '^spring-boot.*test' | sed 's/^/ /' } > output/12-starter-test-only-jars.txt