diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/BuildModelTransformer.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/BuildModelTransformer.java index c1ff4d8efab5..abd91f2d92f3 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/BuildModelTransformer.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/BuildModelTransformer.java @@ -89,7 +89,15 @@ void handleCiFriendlyVersion(ModelTransformerContext context, Model model, Path void handleReactorDependencies(ModelTransformerContext context, Model model, Path pomFile, Model.Builder builder) { List newDeps = new ArrayList<>(); boolean modified = false; + String groupId = model.getGroupId(); + if (groupId == null) { + groupId = model.getParent().getGroupId(); + } for (Dependency dep : model.getDependencies()) { + if (dep.getGroupId() == null) { + dep = dep.withGroupId(groupId); + modified = true; + } if (dep.getVersion() == null) { Model depModel = context.getRawModel(model.getPomFile(), dep.getGroupId(), dep.getArtifactId()); if (depModel != null) {