"Aether" and the Apache Maven resolver are supported. However the docs for this are in very bad shape, and a naive Google search is likely to point you to a lot of outdated and misleading information. https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/dependencies has code for that does this sort of thing. That may give you some more up to date pointers.
You will likely have to use some internal Maven classes to make this work. The "published" API is lacking in a few critical areas. On Sat, Apr 6, 2019 at 9:07 AM Michael Lipp <m...@mnl.de> wrote: > > Hi, > > I've spent considerable time on researching this, but to no avail. The > closest answer that I have found was on Stackoverflow > (https://stackoverflow.com/questions/11674537/retrieving-maven-artifact-from-repository-using-maven-java-api). > But it points me to Eclipse Aether, which has been archived, so it seems > out-dated and not the way to go. > > I also found the "Aether re-integration page" > (http://maven.apache.org/aether.html) and had a look at "Maven Resolver > Provider" > (https://maven.apache.org/ref/3.6.0/maven-resolver-provider/apidocs/index.html?org/apache/maven/repository/internal/MavenRepositorySystemUtils.html), > the "resurrected Aether". What irritates me, however, is that there > doesn't seem to be any connection between the "Maven Resolver Provider" > and the main part of the API. So I wonder if this is just some "left-over". > > Considering the "main parts" of the Maven API, I think I should be able > to start things by creating a LocalArtifactRepository > (https://maven.apache.org/ref/3.6.0/apidocs/index.html), but this is, of > course, not possible, it's abstract. The concrete subclass > UserLocalArtifactRepository isn't of much help, it requires a repository > as constructor argument. > > All other classes that implement "ArtifactRepository" are deprecated. > Which is a pity, because something like "DefaultArtifactRepository" > looks exactly like what I need. But I'm hesitant to start a new project > centering around a deprecated class. > > So, I'm at loss. All I want to do is retrieve some artifacts and their > POMs from a remote repository, using the ~/.m2/repository as cache, as > usual. The ArtifactRepository interface > (https://maven.apache.org/ref/3.6.0/apidocs/index.html) seems perfect > for this. How can I get an object that implements it? > > Thanks! > > - Michael > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org > For additional commands, e-mail: dev-h...@maven.apache.org > -- Elliotte Rusty Harold elh...@ibiblio.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org