Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Plexus container to grab Maven components #166

Closed

Conversation

cstamas
Copy link
Contributor

@cstamas cstamas commented May 17, 2022

As one of the reasons to container is exactly to protect
you (client code) for breakage that is not gonna happen
with components, as instantiation is done by container.

This code is now fully compatible with ALL line of Maven
versions released so far (from lowest that shrinkwrap
resolver requires of course). -- this stands for currently known issues like https://issues.apache.org/jira/projects/MNG/issues/MNG-7475 but naturally there may be more breakages.

As one of the reasons to container is exactly to protect
you (client code) for breakage that is not gonna happen
with components, as instantiation is done by container.

This code is now fully compatible with ALL line of Maven
versions released so far (from lowest that shrinkwrap
resolver requires of course).
To not cope with archaic Plexus API. Still, using
Plexus API may be more suitable, by providing
internal methods that hide checked exceptions
like 1st commit did, as those checked exceptions
should actually be unchecked, as they are terminal).
@cstamas
Copy link
Contributor Author

cstamas commented May 17, 2022

2nd commit:

  • fixed deps in POM
  • switches from Plexus API to Guice Injector. Still, using old Plexus API (and making Guice again back to runtime scope) may be preferable, as archaic Plexus API may be circumvented by internal private methods like done in 1st commit

but wrap it up. Added some examples as well.
@cstamas
Copy link
Contributor Author

cstamas commented May 17, 2022

3rd commit undos change to Injector, is cleaner this way (and keeps Guice as runtime dep). Added some showcase examples as well.

@chengfang
Copy link

@cstamas thanks for submitting the PR. I see it's still a draft, is there more work to be done to fix this issue?

@cstamas
Copy link
Contributor Author

cstamas commented Jun 9, 2023

In the meantime https://github.com/maveniverse/mima was born, so this PR is to be replaced with MIMA one, will do that once home

@cstamas cstamas closed this Jun 9, 2023
@cstamas
Copy link
Contributor Author

cstamas commented Jun 9, 2023

Plexus DI is EOL anyway, not recommended to move to something that is dead/unmaintained already

@cstamas cstamas deleted the use-plexus-to-lookup-components branch June 14, 2023 07:45
@cstamas cstamas restored the use-plexus-to-lookup-components branch June 14, 2023 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants