You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Laird Nelson <lj...@gmail.com> on 2017/03/06 22:20:33 UTC

Formerly Aether, now Maven Artifact Resolver--documentation?

Hello; I'd like to use the Maven Artifact Resolver project (
https://maven.apache.org/resolver/), which, as I understand it, is where
the original Maven dependency resolution code finally ended up after a long
detour through two different companies' attempts to break it off as the
Aether project (Sonatype Aether, Eclipse Aether).

I get the general idea: if I am using it outside of Maven (which I am),
then I should be using the API project (
https://maven.apache.org/resolver/maven-resolver-api/), and hopefully via
some dependency injection system backing it with an implementation.  And
presumably I'd be nuts not to back it with the impl project (
https://maven.apache.org/resolver/maven-resolver-impl/index.html).

The impl project provides a what-looks-like-it-would-be-handy assembler and
service locator of sorts:
https://maven.apache.org/resolver/maven-resolver-impl/apidocs/org/eclipse/aether/impl/DefaultServiceLocator.html.
I suppose I'd like to start by using that.

The Javadocs for it say, among other things:

"To acquire a complete repository system, clients need to add an artifact
descriptor reader, a version resolver, a version range resolver and
optionally some repository connector and transporter factories to access
remote repositories."

Let's say I wanted to make this behave exactly like Maven (i.e. I'd like to
read and work with the local Maven repository cache, etc.), but ultimately
I'm using it to resolve group/artifact/version/packaging/classifier
specifications from something like a command line application.  What
implementations drawn from what Maven-authored projects would I use here?
Do the other submodules listed here (
https://maven.apache.org/resolver/index.html) contain the implementations
described by the Javadocs I cited?  Is there anything missing?  I see
several (presumably) transporter factories in there—would I pick one, or
add all of them?

I have seen this Github repository (https://github.com/eclipse/aether-demo/)
but of course it is for
Aether-as-maintained-by-Eclipse-which-has-now-become-Maven-Artifact-Resolver,
and the Maven-related classes it references are not written to work with
the Maven Artifact Resolver project so I'm not sure how valid the approach
shown here is anymore.

Thanks,
Best,
Laird

Re: Formerly Aether, now Maven Artifact Resolver--documentation?

Posted by Christian Schulte <cs...@schulte.it>.
Am 03/07/17 um 00:06 schrieb Laird Nelson:
> Ah!  After some more bashing around in Github and Maven central searching,
> I found this:
> https://github.com/apache/maven/blob/master/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
> 
> This looks like the replacement for this:
> https://maven.apache.org/ref/3.3.9/maven-aether-provider/apidocs/org/apache/maven/repository/internal/MavenRepositorySystemUtils.html
> 
> ...which suggests to me that maven-resolver-provider is the replacement for
> maven-aether-provider going forward.  If so, I see that the only release of
> this is 3.5.0-alpha-1 (
> http://search.maven.org/#artifactdetails%7Corg.apache.maven%7Cmaven-resolver-provider%7C3.5.0-alpha-1%7Cjar
> ).
> 
> Am I on the right track with all this? Should I follow the general spirit
> of this (
> https://github.com/eclipse/aether-demo/tree/master/aether-demo-snippets/src/main/java/org/eclipse/aether/examples),
> but squinting and making these replacements along the way?

You are correct. maven-aether-provider has been renamed to
maven-resolver-provider. No changes in package names or class names. It
should be possible to just exchange the artifacts.

Regards,
-- 
Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Formerly Aether, now Maven Artifact Resolver--documentation?

Posted by Laird Nelson <lj...@gmail.com>.
Ah!  After some more bashing around in Github and Maven central searching,
I found this:
https://github.com/apache/maven/blob/master/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java

This looks like the replacement for this:
https://maven.apache.org/ref/3.3.9/maven-aether-provider/apidocs/org/apache/maven/repository/internal/MavenRepositorySystemUtils.html

...which suggests to me that maven-resolver-provider is the replacement for
maven-aether-provider going forward.  If so, I see that the only release of
this is 3.5.0-alpha-1 (
http://search.maven.org/#artifactdetails%7Corg.apache.maven%7Cmaven-resolver-provider%7C3.5.0-alpha-1%7Cjar
).

Am I on the right track with all this? Should I follow the general spirit
of this (
https://github.com/eclipse/aether-demo/tree/master/aether-demo-snippets/src/main/java/org/eclipse/aether/examples),
but squinting and making these replacements along the way?

Thanks,
Laird

On Mon, Mar 6, 2017 at 2:31 PM Laird Nelson <lj...@gmail.com> wrote:

> On Mon, Mar 6, 2017 at 2:20 PM Laird Nelson <lj...@gmail.com> wrote:
>
> The Javadocs for it say, among other things:
>
> "To acquire a complete repository system, clients need to add an artifact
> descriptor reader, a version resolver, a version range resolver and
> optionally some repository connector and transporter factories to access
> remote repositories."
>
>
> I also notice that the ArtifactDescriptorReader interface is effectively
> deprecated
> <https://maven.apache.org/resolver/maven-resolver-impl/apidocs/org/eclipse/aether/impl/ArtifactDescriptorReader.html>:
> "This type is provisional and can be changed, moved or removed without
> prior notice."  So that makes me wonder if perhaps I should not be using
> the DefaultServiceLocator that says that its usage is required
> <https://maven.apache.org/resolver/maven-resolver-impl/apidocs/org/eclipse/aether/impl/DefaultServiceLocator.html>?
> If indeed I shouldn't use this class either, then is there an example
> somewhere of how to manually assemble a RepositorySystem out of existing
> spare parts?
>
> Best,
> Laird
>

Re: Formerly Aether, now Maven Artifact Resolver--documentation?

Posted by Laird Nelson <lj...@gmail.com>.
On Mon, Mar 6, 2017 at 2:20 PM Laird Nelson <lj...@gmail.com> wrote:

> The Javadocs for it say, among other things:
>
> "To acquire a complete repository system, clients need to add an artifact
> descriptor reader, a version resolver, a version range resolver and
> optionally some repository connector and transporter factories to access
> remote repositories."
>

I also notice that the ArtifactDescriptorReader interface is effectively
deprecated
<https://maven.apache.org/resolver/maven-resolver-impl/apidocs/org/eclipse/aether/impl/ArtifactDescriptorReader.html>:
"This type is provisional and can be changed, moved or removed without
prior notice."  So that makes me wonder if perhaps I should not be using
the DefaultServiceLocator that says that its usage is required
<https://maven.apache.org/resolver/maven-resolver-impl/apidocs/org/eclipse/aether/impl/DefaultServiceLocator.html>?
If indeed I shouldn't use this class either, then is there an example
somewhere of how to manually assemble a RepositorySystem out of existing
spare parts?

Best,
Laird