diff --git a/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java b/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java index f6124fcc4a..c403bacd94 100644 --- a/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java +++ b/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java @@ -1199,10 +1199,14 @@ public class DefaultModelBuilder implements ModelBuilder { // profile injection List activePomProfiles = getActiveProfiles(interpolatedProfiles, profileActivationContext); - result.setActivePomProfiles(activePomProfiles); model = profileInjector.injectProfiles(model, activePomProfiles, request, this); model = profileInjector.injectProfiles(model, activeExternalProfiles, request, this); + List allProfiles = new ArrayList<>(parentActivePomProfiles.size() + activePomProfiles.size()); + allProfiles.addAll(parentActivePomProfiles); + allProfiles.addAll(activePomProfiles); + result.setActivePomProfiles(allProfiles); + // model interpolation Model resultModel = model; resultModel = interpolateModel(resultModel, request, this);