maven icon indicating copy to clipboard operation
maven copied to clipboard

v4 SPI: Add findModel() to WorkspaceReader SPI

Open gnodet opened this issue 1 month ago • 1 comments

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: TychoWorkspaceReader generates synthetic POMs for P2 artifacts that have no Maven pom.xml. Without findModel(), 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.

gnodet avatar Oct 14 '26 13:10 gnodet

"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.

codewithsinchana avatar Oct 27 '26 17:10 codewithsinchana