While working on maven-artifact-transfer (the independent Aether version bridge) and trying to use it for several plugins I came across some issues, especially when transitive dependencies are required.

IMO an Artifact is a reference to a File based on coordinated (GAV + type, which translates to an extension, sometimes with classifier). An artifact is considered resolved if the File is downloaded.

The artifact itself has no knowledge about transitivity, that's part of the descriptor. Hence there's no such thing as transitive artifacts. However,there are a lot of plugins interested in all the transitive dependencies. Only for Objects like MavenProject, Plugin (which have dependencies) it makes sense to ask for such dependencies. However, a MavenProject is a fully populated instance, which is often too much if somebody just wants to have all transitive dependencies for a specific GAV (or Artifact, but I'd like to avoid this term).

It looks like Artifact is often abused for too much information. Aether already separated resolveArtifact() and resolveDependencies(). Up until now we used to make usage of the ArtifactFactory, but that class is deprecated. Today I discovered the org.apache.maven.repository. RepositorySystem to create Artifacts, but there's only 1 implementation: org.apache.maven.repository.legacy.LegacyRepositorySystem, which is again part of maven-compat.

Is it still an Artifact we want to create when we are interested in transitive dependencies? If so: what's the preferred way? RepositorySystem, which should also get a non-legacy implementation? If not: should we introduce something like ArtifactDescriptor/ArtifactStructure?

Is there a reason why there's no interface for GAV instances usable for Objects like MavenProject, Plugin and Dependency and Artifact

thanks,
Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to