Skip to content

Commit

Permalink
[MNG-8340] Resolve parent according to the exact model location
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Nov 1, 2024
1 parent 4e1152f commit a3cb0d1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,12 @@ private static org.apache.maven.model.building.ModelProblem convert(ModelProblem
@SuppressWarnings({"checkstyle:methodlength", "deprecation"})
private void initProject(MavenProject project, ModelBuilderResult result) {
project.setModel(new org.apache.maven.model.Model(result.getEffectiveModel()));
project.setOriginalModel(new org.apache.maven.model.Model(result.getFileModel()));
Model originalModel = result.getFileModel();
if (originalModel.getParent() != null && originalModel.getParent().getRelativePath() == null) {
originalModel =
originalModel.withParent(originalModel.getParent().withRelativePath(".."));
}
project.setOriginalModel(new org.apache.maven.model.Model(originalModel));

initParent(project, result);

Expand Down

0 comments on commit a3cb0d1

Please sign in to comment.