Repository navigation
fix: resolve the conflict how models are being built - #14124
Conversation
Maven distinguishes how builds a project model and how builds a dependency model. A recent change introduced similar change, but also did introduce conflict; it was handling in-reactor models as external ones: #12953 In this case, users end up with duality, as the in-reactor BOM is fully interpolated, but then, at usage point they end up with something completely different than effective BOM would show. Complete the "is external" check, by considering is artifact part of reactor or not as well.
|
Looking at the On static boolean isExternalOrigin(ModelBuilderRequest request) {
return request.getRequestType() == ModelBuilderRequest.RequestType.CONSUMER_DEPENDENCY
&& request.getSource() != null
&& request.getSource().getModelId() != null;
}The key difference is the On So the fix is correctly scoped to |
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. No issues found.
The ReactorModelSource marker class is a sound design choice — a pure subtype of FileModelSource with no behavior of its own, used solely as a type tag. This is the right pattern for 3.10.x where the resolver API has no richer metadata support.
The condition importSource instanceof ReactorModelSource && !isExternalModelBuildingRequest(request) correctly gates on the outer request. If a dependency POM (external) itself imports a reactor BOM, it won't be escalated to project-mode building — only direct project builds benefit, which is the correct semantics.
The test validates both paths directly: ReactorModelSource → profiles active (count=1), FileModelSource → profiles sandboxed (count=0).
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Maven distinguishes how builds a project model and how builds a dependency model.
A recent change introduced similar change, but also did introduce conflict; it was handling in-reactor models as external ones: #12953
In this case, users end up with duality, as the in-reactor BOM is fully interpolated, but then, at usage point they end up with something completely different than effective BOM would show.
Complete the "is external" check, by considering is artifact part of reactor or not as well.