You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2025/10/07 12:06:19 UTC
Re: [PR] Fix #11009: Prevent StackOverflowError in parent POM resolution [maven]
Copilot commented on code in PR #11106:
URL: https://github.com/apache/maven/pull/11106#discussion_r2410401192
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelBuilder.java:
##########
@@ -1019,6 +1106,15 @@ private void wrongParentRelativePath(Model childModel) {
Model resolveAndReadParentExternally(
Model childModel, Parent parent, DefaultProfileActivationContext profileActivationContext)
throws ModelBuilderException {
+ return resolveAndReadParentExternally(childModel, parent, profileActivationContext, new LinkedHashSet<>());
Review Comment:
The parentChain parameter should be passed through instead of creating a new LinkedHashSet, which breaks cycle detection across external parent resolution calls.
```suggestion
Model childModel, Parent parent, DefaultProfileActivationContext profileActivationContext, Set<String> parentChain)
throws ModelBuilderException {
return resolveAndReadParentExternally(childModel, parent, profileActivationContext, parentChain);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org