@@ -170,14 +170,19 @@ configurations {
170170 // configurations stay safe by default.
171171 configureEach {
172172 if (! isCanBeResolved) return @configureEach
173- // `latestDepTestLibrary` overrides apply ONLY to test-classpath configurations.
174- // They must NOT touch `compileClasspath`, because the whole point of `library(old)` +
175- // `latestDepTestLibrary(newRange)` is to keep the agent compiling against the old API
176- // while testing against the new one. Forcing the override onto compileClasspath would
177- // upgrade the compileOnly `library(...)` version and break compilation (e.g.
178- // scala-fork-join-2.8 compiles against scala 2.8 APIs, vertx-sql-client-4.0 against
179- // generic vertx 4.0 APIs, elasticsearch-transport-5.0 against generic ES 5.0 APIs).
180- val applyOverrides = name.contains(" test" , ignoreCase = true )
173+ // `latestDepTestLibrary` overrides apply ONLY to the main test/latestDepTest
174+ // configurations. They must NOT touch `compileClasspath`, because the whole point of
175+ // `library(old)` + `latestDepTestLibrary(newRange)` is to keep the agent compiling
176+ // against the old API while testing against the new one. Forcing the override onto
177+ // compileClasspath would upgrade the compileOnly `library(...)` version and break
178+ // compilation (e.g. scala-fork-join-2.8 compiles against scala 2.8 APIs,
179+ // vertx-sql-client-4.0 against generic vertx 4.0 APIs, elasticsearch-transport-5.0
180+ // against generic ES 5.0 APIs). Overrides must also NOT touch custom JvmTestSuite
181+ // source sets (e.g. `play24Test*`, `version20Test*`, `tapirTest*`) which declare
182+ // their own explicit older versions; using `contains("test")` here would let the
183+ // main suite's `latestDepTestLibrary("...:2.5.+")` upgrade play-mvc-2.4's
184+ // `play24Test` classpath off Play 2.4. Use a strict prefix match instead.
185+ val applyOverrides = name.startsWith(" test" ) || name.startsWith(" latestDepTest" )
181186 // Pinning of `latest.release`/`+` versions is applied across test-related
182187 // configurations and the main `compileClasspath`. compileClasspath is included so
183188 // that modules whose `library(...)` declarations resolve `latest.release` in latest
0 commit comments