Commits
Tarun Sukhani authored 8c51aa310a2
fix: ant resolve falls through to Maven Central for newly declared deps (PF-83)
Three implementation agents in this session (PF-9, PF-12, PF-13) each hit
the same papercut: declaring a brand-new module in framework/dependencies.yml
and running `ant resolve` fails with "module not found" instead of fetching
from Maven Central. Each agent worked around it by curl-fetching jars from
Central into framework/lib/ before resolution.
Root cause: framework/dependencies.yml registered playCoreDependencies as a
type: local resolver listing every required dep in its contains: block.
SettingsParser.parse() iterates contains: entries and calls
IvySettings.addModuleConfiguration to pin each module to that one resolver.
That pin is a hard route — Ivy does NOT fall through to other resolvers
when the pinned resolver returns "not found". So a dep that lacked a local
jar terminated resolution with no chance for mavenCentral to be consulted.
Fix shape (option A from the ticket — resolver chain order): convert
playCoreDependencies from a single local resolver into a chain repository
[playCoreDependenciesLocal (file-system), playCoreDependenciesCentral
(iBiblio)]. SettingsParser's chain branch sets returnFirst=true (already
the default for chains) and forwards the outer repo's contains: pin to the
chain resolver. Cached jars short-circuit at the local layer; absent jars
fall through to Central and land in framework/lib/ on first run. Pure YAML
change — no Java code touched, no new code paths to test in isolation
beyond the existing chain machinery.
End-to-end validation:
1. Reproduced on pre-fix tree: added `org.apache.commons -> commons-csv 1.11.0`
to the require: list, ran `ant resolve` — failed with "module not found:
org.apache.commons#commons-csv;1.11.0" and only playCoreDependencies
tried (no Maven Central attempt).
2. Applied the chain fix.
3. Re-ran `ant resolve` with the same temporary line — succeeded:
`downloading https://repo1.maven.org/maven2/.../commons-csv-1.11.0.jar`,
then `+lib/commons-csv-1.11.0.jar`. All 117 existing artifacts continued
to resolve from playCoreDependenciesLocal (no network calls for them).
4. Removed the temporary line, ran `ant resolve -Dprune=true` — pruned
the test jar cleanly.
5. `ant clean unittest` passed.
The temporary commons-csv line is reverted in this commit — only the
resolver chain change is shipped.
No regression on offline-cached deps: same artifact:
"${play.path}/framework/lib/[artifact]-[revision](-[classifier]).jar"
pattern is still tried first by playCoreDependenciesLocal, so any
previously-cached jar (including classifier-bearing native jars) hits the
local layer exactly as before. The PF-57 classifier syntax comment carries
forward into the inner local resolver unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>