You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Christoph Läubrich <ma...@laeubi-soft.de> on 2022/09/26 10:06:57 UTC
What is the recommended approach to get org.apache.maven.repository.RepositorySystem in 3.8.6?
I'm currently writing a test for a component that requires
org.apache.maven.repository.RepositorySystem
the problem is that it seems the only implementation of this is
LegacyRepositorySystem that is part of maven-compat (and thus I'd like
to avoid adding that as a dependency)
So I see two options:
1) There is a new alterantive that implements
org.apache.maven.repository.RepositorySystem but I just don't know about?
2) I could try to refactor my code to not using
org.apache.maven.repository.RepositorySystem, but what should be the
alternative?
org.apache.maven.repository.RepositorySystem is not deprecated and I
can't see any note that something else should be used instead...
any hints?
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: What is the recommended approach to get org.apache.maven.repository.RepositorySystem in 3.8.6?
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Guess we can let it live the time we go to the new clean API of maven 4?
Not sure it is worth doing any work in v3 since everything will be cleanly
hosted in v4 so would impose 2 migrations if we do.
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>
Le lun. 26 sept. 2022 à 18:11, Slawomir Jaranowski <s....@gmail.com>
a écrit :
> Hi,
>
> Maybe it is time to deprecate org.apache.maven.repository.RepositorySystem
>
> We should document replacement for each method.
>
>
>
> pon., 26 wrz 2022 o 15:04 Tamás Cservenák <ta...@cservenak.net>
> napisał(a):
>
> > Howdy,
> >
> > As I see your use case "in the particular case we \"simply\" resolve an
> > artifact with its dependencies" is basically very much same as
> m-compiler-p
> > does to get annotation processors.
> > Hence, I did this just to see:
> > https://github.com/apache/maven-compiler-plugin/pull/151
> >
> > Hope it helps
> > T
> >
> > On Mon, Sep 26, 2022 at 1:05 PM Christoph Läubrich <ma...@laeubi-soft.de>
> > wrote:
> >
> > > THanks for the hints, in general I'm currently cleanup/refactor Tycho
> > > but still there are places where maven-compat seems required (and the
> > > tests is such a part sadly).
> > >
> > > Tycho requires maven-3.8.6 as a minimum and hopefully will move on to
> > > maven 3.9.x once it is released (and we got rid of the compat stuff).
> > >
> > > I think I'll try as you suggested and get rid of
> > > org.apache.maven.repository.RepositorySystem in favor of
> > > org.eclipse.aether.RepositorySystemSession, just need to check how this
> > > new stuff all works, in the particular case we "simply" resolve an
> > > artifact with its dependencies using
> > >
> > > @Requirement
> > > private RepositorySystem repositorySystem;
> > >
> > > org.apache.maven.repository.RepositorySystem.createArtifact(...)
> > >
> > > and
> > >
> > >
> > >
> >
> org.apache.maven.repository.RepositorySystem.resolve(ArtifactResolutionRequest)
> > >
> > > calls ...
> > >
> > >
> > > Am 26.09.22 um 12:47 schrieb Tamás Cservenák:
> > > > Howdy,
> > > >
> > > > you did not specify what is what you exactly look for.... but in
> > general:
> > > > definitely avoid maven-compat (maven2 support).
> > > >
> > > > Your best bet is to:
> > > > - NOT support older Maven then 3.1, then you save yourself from
> > > > aether/resolver package change (so no need for things like
> > > > https://github.com/apache/maven-artifact-transfer and alike)
> > > > - go directly for resolver API
> > > (org.eclipse.aether.RepositorySystemSession
> > > > and related ones) -- this is the recommended way today (as Maven
> itself
> > > > "lifted" minimal Maven version to 3.1+ as well, Maven 3.0 is dead and
> > to
> > > be
> > > > completely forgotten).
> > > > - maven 4 will introduce new API (
> > > https://github.com/apache/maven/pull/703)
> > > > but only in 4+ versions (and will provide a "window" for
> > > plugins/extensions
> > > > to move from resolver-direct to API use), so several Maven 4.x
> versions
> > > > will support both: "direct" resolver access but also provide API as
> > well.
> > > > At one point, maven "core" (never meant as "API") access will be shut
> > > off.
> > > >
> > > > also, take a peek at this (and related) pages
> > > >
> > >
> >
> https://cwiki.apache.org/confluence/display/MAVEN/Maven+Ecosystem+Cleanup
> > > >
> > > > So, if you are in position to ignore Maven 3.0, then you are free to
> > use
> > > > resolver API directly w/o issue. True, in future, migration to Maven
> 4
> > > API
> > > > will be inevitable, but until core access is not shut down (no exact
> > > > timeline for it), you are fine. Again, your mileage may vary, as the
> > > > interface you refer to is really huge...
> > > >
> > > >
> > > > HTH
> > > > T
> > > >
> > > > On Mon, Sep 26, 2022 at 12:07 PM Christoph Läubrich <
> > mail@laeubi-soft.de
> > > >
> > > > wrote:
> > > >
> > > >> I'm currently writing a test for a component that requires
> > > >>
> > > >> org.apache.maven.repository.RepositorySystem
> > > >>
> > > >> the problem is that it seems the only implementation of this is
> > > >> LegacyRepositorySystem that is part of maven-compat (and thus I'd
> like
> > > >> to avoid adding that as a dependency)
> > > >>
> > > >> So I see two options:
> > > >>
> > > >> 1) There is a new alterantive that implements
> > > >> org.apache.maven.repository.RepositorySystem but I just don't know
> > > about?
> > > >>
> > > >> 2) I could try to refactor my code to not using
> > > >> org.apache.maven.repository.RepositorySystem, but what should be the
> > > >> alternative?
> > > >>
> > > >> org.apache.maven.repository.RepositorySystem is not deprecated and I
> > > >> can't see any note that something else should be used instead...
> > > >>
> > > >> any hints?
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > >> For additional commands, e-mail: dev-help@maven.apache.org
> > > >>
> > > >>
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> >
>
>
> --
> Sławomir Jaranowski
>
Re: What is the recommended approach to get org.apache.maven.repository.RepositorySystem in 3.8.6?
Posted by Sylwester Lachiewicz <sl...@gmail.com>.
Be careful with this class, see
https://issues.apache.org/jira/browse/MNG-6642
pon., 26 wrz 2022, 18:11 użytkownik Slawomir Jaranowski <
s.jaranowski@gmail.com> napisał:
> Hi,
>
> Maybe it is time to deprecate org.apache.maven.repository.RepositorySystem
>
> We should document replacement for each method.
>
>
>
> pon., 26 wrz 2022 o 15:04 Tamás Cservenák <ta...@cservenak.net>
> napisał(a):
>
> > Howdy,
> >
> > As I see your use case "in the particular case we \"simply\" resolve an
> > artifact with its dependencies" is basically very much same as
> m-compiler-p
> > does to get annotation processors.
> > Hence, I did this just to see:
> > https://github.com/apache/maven-compiler-plugin/pull/151
> >
> > Hope it helps
> > T
> >
> > On Mon, Sep 26, 2022 at 1:05 PM Christoph Läubrich <ma...@laeubi-soft.de>
> > wrote:
> >
> > > THanks for the hints, in general I'm currently cleanup/refactor Tycho
> > > but still there are places where maven-compat seems required (and the
> > > tests is such a part sadly).
> > >
> > > Tycho requires maven-3.8.6 as a minimum and hopefully will move on to
> > > maven 3.9.x once it is released (and we got rid of the compat stuff).
> > >
> > > I think I'll try as you suggested and get rid of
> > > org.apache.maven.repository.RepositorySystem in favor of
> > > org.eclipse.aether.RepositorySystemSession, just need to check how this
> > > new stuff all works, in the particular case we "simply" resolve an
> > > artifact with its dependencies using
> > >
> > > @Requirement
> > > private RepositorySystem repositorySystem;
> > >
> > > org.apache.maven.repository.RepositorySystem.createArtifact(...)
> > >
> > > and
> > >
> > >
> > >
> >
> org.apache.maven.repository.RepositorySystem.resolve(ArtifactResolutionRequest)
> > >
> > > calls ...
> > >
> > >
> > > Am 26.09.22 um 12:47 schrieb Tamás Cservenák:
> > > > Howdy,
> > > >
> > > > you did not specify what is what you exactly look for.... but in
> > general:
> > > > definitely avoid maven-compat (maven2 support).
> > > >
> > > > Your best bet is to:
> > > > - NOT support older Maven then 3.1, then you save yourself from
> > > > aether/resolver package change (so no need for things like
> > > > https://github.com/apache/maven-artifact-transfer and alike)
> > > > - go directly for resolver API
> > > (org.eclipse.aether.RepositorySystemSession
> > > > and related ones) -- this is the recommended way today (as Maven
> itself
> > > > "lifted" minimal Maven version to 3.1+ as well, Maven 3.0 is dead and
> > to
> > > be
> > > > completely forgotten).
> > > > - maven 4 will introduce new API (
> > > https://github.com/apache/maven/pull/703)
> > > > but only in 4+ versions (and will provide a "window" for
> > > plugins/extensions
> > > > to move from resolver-direct to API use), so several Maven 4.x
> versions
> > > > will support both: "direct" resolver access but also provide API as
> > well.
> > > > At one point, maven "core" (never meant as "API") access will be shut
> > > off.
> > > >
> > > > also, take a peek at this (and related) pages
> > > >
> > >
> >
> https://cwiki.apache.org/confluence/display/MAVEN/Maven+Ecosystem+Cleanup
> > > >
> > > > So, if you are in position to ignore Maven 3.0, then you are free to
> > use
> > > > resolver API directly w/o issue. True, in future, migration to Maven
> 4
> > > API
> > > > will be inevitable, but until core access is not shut down (no exact
> > > > timeline for it), you are fine. Again, your mileage may vary, as the
> > > > interface you refer to is really huge...
> > > >
> > > >
> > > > HTH
> > > > T
> > > >
> > > > On Mon, Sep 26, 2022 at 12:07 PM Christoph Läubrich <
> > mail@laeubi-soft.de
> > > >
> > > > wrote:
> > > >
> > > >> I'm currently writing a test for a component that requires
> > > >>
> > > >> org.apache.maven.repository.RepositorySystem
> > > >>
> > > >> the problem is that it seems the only implementation of this is
> > > >> LegacyRepositorySystem that is part of maven-compat (and thus I'd
> like
> > > >> to avoid adding that as a dependency)
> > > >>
> > > >> So I see two options:
> > > >>
> > > >> 1) There is a new alterantive that implements
> > > >> org.apache.maven.repository.RepositorySystem but I just don't know
> > > about?
> > > >>
> > > >> 2) I could try to refactor my code to not using
> > > >> org.apache.maven.repository.RepositorySystem, but what should be the
> > > >> alternative?
> > > >>
> > > >> org.apache.maven.repository.RepositorySystem is not deprecated and I
> > > >> can't see any note that something else should be used instead...
> > > >>
> > > >> any hints?
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > >> For additional commands, e-mail: dev-help@maven.apache.org
> > > >>
> > > >>
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> >
>
>
> --
> Sławomir Jaranowski
>
Re: What is the recommended approach to get org.apache.maven.repository.RepositorySystem in 3.8.6?
Posted by Slawomir Jaranowski <s....@gmail.com>.
Hi,
Maybe it is time to deprecate org.apache.maven.repository.RepositorySystem
We should document replacement for each method.
pon., 26 wrz 2022 o 15:04 Tamás Cservenák <ta...@cservenak.net> napisał(a):
> Howdy,
>
> As I see your use case "in the particular case we \"simply\" resolve an
> artifact with its dependencies" is basically very much same as m-compiler-p
> does to get annotation processors.
> Hence, I did this just to see:
> https://github.com/apache/maven-compiler-plugin/pull/151
>
> Hope it helps
> T
>
> On Mon, Sep 26, 2022 at 1:05 PM Christoph Läubrich <ma...@laeubi-soft.de>
> wrote:
>
> > THanks for the hints, in general I'm currently cleanup/refactor Tycho
> > but still there are places where maven-compat seems required (and the
> > tests is such a part sadly).
> >
> > Tycho requires maven-3.8.6 as a minimum and hopefully will move on to
> > maven 3.9.x once it is released (and we got rid of the compat stuff).
> >
> > I think I'll try as you suggested and get rid of
> > org.apache.maven.repository.RepositorySystem in favor of
> > org.eclipse.aether.RepositorySystemSession, just need to check how this
> > new stuff all works, in the particular case we "simply" resolve an
> > artifact with its dependencies using
> >
> > @Requirement
> > private RepositorySystem repositorySystem;
> >
> > org.apache.maven.repository.RepositorySystem.createArtifact(...)
> >
> > and
> >
> >
> >
> org.apache.maven.repository.RepositorySystem.resolve(ArtifactResolutionRequest)
> >
> > calls ...
> >
> >
> > Am 26.09.22 um 12:47 schrieb Tamás Cservenák:
> > > Howdy,
> > >
> > > you did not specify what is what you exactly look for.... but in
> general:
> > > definitely avoid maven-compat (maven2 support).
> > >
> > > Your best bet is to:
> > > - NOT support older Maven then 3.1, then you save yourself from
> > > aether/resolver package change (so no need for things like
> > > https://github.com/apache/maven-artifact-transfer and alike)
> > > - go directly for resolver API
> > (org.eclipse.aether.RepositorySystemSession
> > > and related ones) -- this is the recommended way today (as Maven itself
> > > "lifted" minimal Maven version to 3.1+ as well, Maven 3.0 is dead and
> to
> > be
> > > completely forgotten).
> > > - maven 4 will introduce new API (
> > https://github.com/apache/maven/pull/703)
> > > but only in 4+ versions (and will provide a "window" for
> > plugins/extensions
> > > to move from resolver-direct to API use), so several Maven 4.x versions
> > > will support both: "direct" resolver access but also provide API as
> well.
> > > At one point, maven "core" (never meant as "API") access will be shut
> > off.
> > >
> > > also, take a peek at this (and related) pages
> > >
> >
> https://cwiki.apache.org/confluence/display/MAVEN/Maven+Ecosystem+Cleanup
> > >
> > > So, if you are in position to ignore Maven 3.0, then you are free to
> use
> > > resolver API directly w/o issue. True, in future, migration to Maven 4
> > API
> > > will be inevitable, but until core access is not shut down (no exact
> > > timeline for it), you are fine. Again, your mileage may vary, as the
> > > interface you refer to is really huge...
> > >
> > >
> > > HTH
> > > T
> > >
> > > On Mon, Sep 26, 2022 at 12:07 PM Christoph Läubrich <
> mail@laeubi-soft.de
> > >
> > > wrote:
> > >
> > >> I'm currently writing a test for a component that requires
> > >>
> > >> org.apache.maven.repository.RepositorySystem
> > >>
> > >> the problem is that it seems the only implementation of this is
> > >> LegacyRepositorySystem that is part of maven-compat (and thus I'd like
> > >> to avoid adding that as a dependency)
> > >>
> > >> So I see two options:
> > >>
> > >> 1) There is a new alterantive that implements
> > >> org.apache.maven.repository.RepositorySystem but I just don't know
> > about?
> > >>
> > >> 2) I could try to refactor my code to not using
> > >> org.apache.maven.repository.RepositorySystem, but what should be the
> > >> alternative?
> > >>
> > >> org.apache.maven.repository.RepositorySystem is not deprecated and I
> > >> can't see any note that something else should be used instead...
> > >>
> > >> any hints?
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: dev-help@maven.apache.org
> > >>
> > >>
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
--
Sławomir Jaranowski
Re: What is the recommended approach to get org.apache.maven.repository.RepositorySystem in 3.8.6?
Posted by Tamás Cservenák <ta...@cservenak.net>.
Howdy,
As I see your use case "in the particular case we \"simply\" resolve an
artifact with its dependencies" is basically very much same as m-compiler-p
does to get annotation processors.
Hence, I did this just to see:
https://github.com/apache/maven-compiler-plugin/pull/151
Hope it helps
T
On Mon, Sep 26, 2022 at 1:05 PM Christoph Läubrich <ma...@laeubi-soft.de>
wrote:
> THanks for the hints, in general I'm currently cleanup/refactor Tycho
> but still there are places where maven-compat seems required (and the
> tests is such a part sadly).
>
> Tycho requires maven-3.8.6 as a minimum and hopefully will move on to
> maven 3.9.x once it is released (and we got rid of the compat stuff).
>
> I think I'll try as you suggested and get rid of
> org.apache.maven.repository.RepositorySystem in favor of
> org.eclipse.aether.RepositorySystemSession, just need to check how this
> new stuff all works, in the particular case we "simply" resolve an
> artifact with its dependencies using
>
> @Requirement
> private RepositorySystem repositorySystem;
>
> org.apache.maven.repository.RepositorySystem.createArtifact(...)
>
> and
>
>
> org.apache.maven.repository.RepositorySystem.resolve(ArtifactResolutionRequest)
>
> calls ...
>
>
> Am 26.09.22 um 12:47 schrieb Tamás Cservenák:
> > Howdy,
> >
> > you did not specify what is what you exactly look for.... but in general:
> > definitely avoid maven-compat (maven2 support).
> >
> > Your best bet is to:
> > - NOT support older Maven then 3.1, then you save yourself from
> > aether/resolver package change (so no need for things like
> > https://github.com/apache/maven-artifact-transfer and alike)
> > - go directly for resolver API
> (org.eclipse.aether.RepositorySystemSession
> > and related ones) -- this is the recommended way today (as Maven itself
> > "lifted" minimal Maven version to 3.1+ as well, Maven 3.0 is dead and to
> be
> > completely forgotten).
> > - maven 4 will introduce new API (
> https://github.com/apache/maven/pull/703)
> > but only in 4+ versions (and will provide a "window" for
> plugins/extensions
> > to move from resolver-direct to API use), so several Maven 4.x versions
> > will support both: "direct" resolver access but also provide API as well.
> > At one point, maven "core" (never meant as "API") access will be shut
> off.
> >
> > also, take a peek at this (and related) pages
> >
> https://cwiki.apache.org/confluence/display/MAVEN/Maven+Ecosystem+Cleanup
> >
> > So, if you are in position to ignore Maven 3.0, then you are free to use
> > resolver API directly w/o issue. True, in future, migration to Maven 4
> API
> > will be inevitable, but until core access is not shut down (no exact
> > timeline for it), you are fine. Again, your mileage may vary, as the
> > interface you refer to is really huge...
> >
> >
> > HTH
> > T
> >
> > On Mon, Sep 26, 2022 at 12:07 PM Christoph Läubrich <mail@laeubi-soft.de
> >
> > wrote:
> >
> >> I'm currently writing a test for a component that requires
> >>
> >> org.apache.maven.repository.RepositorySystem
> >>
> >> the problem is that it seems the only implementation of this is
> >> LegacyRepositorySystem that is part of maven-compat (and thus I'd like
> >> to avoid adding that as a dependency)
> >>
> >> So I see two options:
> >>
> >> 1) There is a new alterantive that implements
> >> org.apache.maven.repository.RepositorySystem but I just don't know
> about?
> >>
> >> 2) I could try to refactor my code to not using
> >> org.apache.maven.repository.RepositorySystem, but what should be the
> >> alternative?
> >>
> >> org.apache.maven.repository.RepositorySystem is not deprecated and I
> >> can't see any note that something else should be used instead...
> >>
> >> any hints?
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: dev-help@maven.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
Re: What is the recommended approach to get org.apache.maven.repository.RepositorySystem in 3.8.6?
Posted by Christoph Läubrich <ma...@laeubi-soft.de>.
THanks for the hints, in general I'm currently cleanup/refactor Tycho
but still there are places where maven-compat seems required (and the
tests is such a part sadly).
Tycho requires maven-3.8.6 as a minimum and hopefully will move on to
maven 3.9.x once it is released (and we got rid of the compat stuff).
I think I'll try as you suggested and get rid of
org.apache.maven.repository.RepositorySystem in favor of
org.eclipse.aether.RepositorySystemSession, just need to check how this
new stuff all works, in the particular case we "simply" resolve an
artifact with its dependencies using
@Requirement
private RepositorySystem repositorySystem;
org.apache.maven.repository.RepositorySystem.createArtifact(...)
and
org.apache.maven.repository.RepositorySystem.resolve(ArtifactResolutionRequest)
calls ...
Am 26.09.22 um 12:47 schrieb Tamás Cservenák:
> Howdy,
>
> you did not specify what is what you exactly look for.... but in general:
> definitely avoid maven-compat (maven2 support).
>
> Your best bet is to:
> - NOT support older Maven then 3.1, then you save yourself from
> aether/resolver package change (so no need for things like
> https://github.com/apache/maven-artifact-transfer and alike)
> - go directly for resolver API (org.eclipse.aether.RepositorySystemSession
> and related ones) -- this is the recommended way today (as Maven itself
> "lifted" minimal Maven version to 3.1+ as well, Maven 3.0 is dead and to be
> completely forgotten).
> - maven 4 will introduce new API (https://github.com/apache/maven/pull/703)
> but only in 4+ versions (and will provide a "window" for plugins/extensions
> to move from resolver-direct to API use), so several Maven 4.x versions
> will support both: "direct" resolver access but also provide API as well.
> At one point, maven "core" (never meant as "API") access will be shut off.
>
> also, take a peek at this (and related) pages
> https://cwiki.apache.org/confluence/display/MAVEN/Maven+Ecosystem+Cleanup
>
> So, if you are in position to ignore Maven 3.0, then you are free to use
> resolver API directly w/o issue. True, in future, migration to Maven 4 API
> will be inevitable, but until core access is not shut down (no exact
> timeline for it), you are fine. Again, your mileage may vary, as the
> interface you refer to is really huge...
>
>
> HTH
> T
>
> On Mon, Sep 26, 2022 at 12:07 PM Christoph Läubrich <ma...@laeubi-soft.de>
> wrote:
>
>> I'm currently writing a test for a component that requires
>>
>> org.apache.maven.repository.RepositorySystem
>>
>> the problem is that it seems the only implementation of this is
>> LegacyRepositorySystem that is part of maven-compat (and thus I'd like
>> to avoid adding that as a dependency)
>>
>> So I see two options:
>>
>> 1) There is a new alterantive that implements
>> org.apache.maven.repository.RepositorySystem but I just don't know about?
>>
>> 2) I could try to refactor my code to not using
>> org.apache.maven.repository.RepositorySystem, but what should be the
>> alternative?
>>
>> org.apache.maven.repository.RepositorySystem is not deprecated and I
>> can't see any note that something else should be used instead...
>>
>> any hints?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: What is the recommended approach to get org.apache.maven.repository.RepositorySystem in 3.8.6?
Posted by Tamás Cservenák <ta...@cservenak.net>.
Howdy,
you did not specify what is what you exactly look for.... but in general:
definitely avoid maven-compat (maven2 support).
Your best bet is to:
- NOT support older Maven then 3.1, then you save yourself from
aether/resolver package change (so no need for things like
https://github.com/apache/maven-artifact-transfer and alike)
- go directly for resolver API (org.eclipse.aether.RepositorySystemSession
and related ones) -- this is the recommended way today (as Maven itself
"lifted" minimal Maven version to 3.1+ as well, Maven 3.0 is dead and to be
completely forgotten).
- maven 4 will introduce new API (https://github.com/apache/maven/pull/703)
but only in 4+ versions (and will provide a "window" for plugins/extensions
to move from resolver-direct to API use), so several Maven 4.x versions
will support both: "direct" resolver access but also provide API as well.
At one point, maven "core" (never meant as "API") access will be shut off.
also, take a peek at this (and related) pages
https://cwiki.apache.org/confluence/display/MAVEN/Maven+Ecosystem+Cleanup
So, if you are in position to ignore Maven 3.0, then you are free to use
resolver API directly w/o issue. True, in future, migration to Maven 4 API
will be inevitable, but until core access is not shut down (no exact
timeline for it), you are fine. Again, your mileage may vary, as the
interface you refer to is really huge...
HTH
T
On Mon, Sep 26, 2022 at 12:07 PM Christoph Läubrich <ma...@laeubi-soft.de>
wrote:
> I'm currently writing a test for a component that requires
>
> org.apache.maven.repository.RepositorySystem
>
> the problem is that it seems the only implementation of this is
> LegacyRepositorySystem that is part of maven-compat (and thus I'd like
> to avoid adding that as a dependency)
>
> So I see two options:
>
> 1) There is a new alterantive that implements
> org.apache.maven.repository.RepositorySystem but I just don't know about?
>
> 2) I could try to refactor my code to not using
> org.apache.maven.repository.RepositorySystem, but what should be the
> alternative?
>
> org.apache.maven.repository.RepositorySystem is not deprecated and I
> can't see any note that something else should be used instead...
>
> any hints?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>