Le dimanche 12 juillet 2015 20:26:36 Robert Scholte a écrit : > 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). that's why we need a simple API to calculate transitive dependencies for an artifact, doing just what's necessary to get that
> > It looks like Artifact is often abused for too much information. yes, Maven Artifact is not really well documented (no javadoc at all), and has methods of constants both for GAV and for dependencies > Aether > already separated resolveArtifact() and resolveDependencies(). > Up until now we used to make usage of the ArtifactFactory, but that class > is deprecated. the more I think about it, the more I think this deprecation was just in the spirit of using Aether: but since we need the bridge for multiple Aether version, IMHO we should simply remove the deprecation (or better explain the idea behind it and target APIs) > 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? why not? IMHO, when we use an (o.a.m.a.)Artifact, we're trying to have compatibility, then we can't avoid this class This compatibility expectation makes that we can't whange the API: perhaps we should start by documenting which part of the API is part of dependency handling: that would be a starting point Of course, while at it with maven-artifact-transfert, we could include a dedicated API in this component > 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? IMHO, just un-deprecate ArtifactFactory Regards, Hervé > > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
