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-8242] Cache flattened parents during model building #1703

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Sep 7, 2024

JIRA issue: https://issues.apache.org/jira/browse/MNG-8242

During model building, we do not cache any hierarchy inheritance due to profiles that may be activated based on properties from the child projects.
So there's no way to cache the effective parent and just inject it into the child, the whole hierarchy need to be taken into account.
However, flattening the parent (i.e. inject the flattened parent's parent into the raw parent) should provide a parent model which has no parents anymore, not activated and not interpolated, but which can be cached and reused.

@gnodet gnodet added this to the 4.0.0-beta-5 milestone Sep 8, 2024
@gnodet gnodet requested a review from cstamas September 9, 2024 09:05
@gnodet gnodet force-pushed the MNG-8242 branch 2 times, most recently from bea30ec to 2ac280f Compare September 12, 2024 06:54
During model building, we do not cache any hierarchy inheritance due to profiles that may be activated based on properties from the child projects.
So there's no way to cache the effective parent and just inject it into the child, the whole hierarchy need to be taken into account.
However, flattening the parent (i.e. inject the flattened parent's parent into the raw parent) should provide a parent model which has no parents anymore, not activated and not interpolated, but which can be cached and reused.

# Conflicts:
#	maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java

# Conflicts:
#	maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/DefaultModelResolver.java
#	maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
@gnodet gnodet merged commit e1e23d9 into apache:master Sep 18, 2024
13 checks passed
@gnodet gnodet deleted the MNG-8242 branch September 18, 2024 14:56
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