v4 SPI: Add findModel() to WorkspaceReader SPI
Parent: #13499 | Related: PR #13094
Problem
PR #13094 introduces org.apache.maven.api.spi.WorkspaceReader with findArtifact()
and findVersions(). This covers the base WorkspaceReader contract, but the v3
MavenWorkspaceReader interface also provides findModel(Artifact) — which has no
equivalent in the new SPI.
Who needs this
- Tycho:
TychoWorkspaceReadergenerates synthetic POMs for P2 artifacts that have no Maven pom.xml. WithoutfindModel(), the workspace reader can serve artifact files but not their models, breaking Tycho's ability to present P2/OSGi bundles as Maven dependencies.
What's needed
Add a findModel() method (or equivalent model-provision mechanism) to the v4
WorkspaceReader SPI for extensions that resolve non-Maven artifacts requiring
synthetic model generation.
default Optional<Path> findModel(Artifact artifact) {
return Optional.empty();
}
🤖 Drafted with Claude Code (Claude Opus 4.6, interactive mode). Reviewed and confirmed by @gnodet before submission.
"Hi @gnondet, I'd love to help out with this or provide additional test coverage/implementation if it's still open. Is there anything specific needed here?" This prevents duplicated effort.