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-8123] Fix Lifecycle in v3 #1524

Merged
merged 3 commits into from
May 22, 2024
Merged

[MNG-8123] Fix Lifecycle in v3 #1524

merged 3 commits into from
May 22, 2024

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented May 17, 2024

@gnodet gnodet requested a review from cstamas May 17, 2024 12:49
Map<String, org.apache.maven.lifecycle.Lifecycle> all =
container.lookupMap(org.apache.maven.lifecycle.Lifecycle.class);
return all.keySet().stream()
.filter(id -> !Lifecycle.CLEAN.equals(id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this filter? How are these 4 lifecycles published? Or in other words, why distinguish these 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a kind of chicken/egg situation. Lifecycle can be published by maven 3 extensions, but lifecycles must also be provided through the Maven 3 API. We must avoid rewrapping in a kind of loop the default lifecycles exposed using the maven 4 API because it leads to a lookup error (we end-up with a bean creation cycle).

I can see if there's a better way, such as adding a new sub-interface WrappedLifecycle to better detect where the lifecycle come from (Maven 3 or 4 api and only wrap if for the other side).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I can't use the instance to detect, as getting the instance will cause the lookup error: the map is lazily managed by sisu, and the instance is created when requested only, but that's what causes the lookup error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this somewhat similar to Type / ArtifactHandler story? Is same problem present there as well?

@gnodet gnodet added this to the 4.0.0-beta-3 milestone May 21, 2024
@gnodet gnodet merged commit 2942aad into apache:master May 22, 2024
13 checks passed
@gnodet gnodet deleted the MNG-8123 branch July 12, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants