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

[MNG-7667] Fix DownloadMojo to properly resolve #236

Merged
merged 4 commits into from
Jan 16, 2023

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Jan 16, 2023

The m-p-p depends on m-p-tools-ant and m-p-tools-beanshell as runtime/optional, and the way DownloadMojo resolves every artifact causes that OptionalDependencySelector filter these out even at "collection" stage (as depth >= 2).

Hence, fix DownloadMojo to resolve properly, that actually shifts all the tree "one level up", and hence result is same as in Maven, as the optional dependencies become "first level sibling".


https://issues.apache.org/jira/browse/MNG-7667

The m-p-p depends on m-p-tools-and and m-p-tools-beanshell as
runtime/optional, and the way DownloadMojo resolves every
artifacy causes that OptionalDependencySelector filter these
out even at "collection" stage (as depth >= 2).

This is NOT happening while m-p-p resolved as plugin, as there
m-p-p artifact POM is built and each dependency is being resolved
(hence all the "depth levels" are shifted for -1).

Doing this in DownloadMojo would tremendously slow down the process,
so adding a hack instead: when m-p-p is being resolved, we use
"hack" session that omits OptionalDependencySelector.

---

https://issues.apache.org/jira/browse/MNG-7667
@cstamas cstamas self-assigned this Jan 16, 2023
@cstamas cstamas marked this pull request as ready for review January 16, 2023 10:18
@cstamas
Copy link
Member Author

cstamas commented Jan 16, 2023

Am redoing this, instead of hack make it proper, turns out reading POM is not such a big overhead (and is anyway done already as part of collection).

@cstamas cstamas changed the title [MNG-7667] Improve fix that cover m-p-p peculiarity [MNG-7667] Fix DownloadMojo to properly resolve Jan 16, 2023
@cstamas cstamas merged commit ffdc2ed into apache:master Jan 16, 2023
@cstamas cstamas deleted the hack-bootstrap branch January 16, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant