Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Sep 27, 2024
1 parent 6d78b75 commit be716a4
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ private DefaultModelBuilderSession(
this.pomRepositories = pomRepositories;
this.externalRepositories = externalRepositories;
this.repositories = repositories;
this.result.setSource(this.request.getSource());
}

DefaultModelBuilderSession derive(ModelSource source) {
Expand Down Expand Up @@ -1221,8 +1222,8 @@ private Model readEffectiveModel() throws ModelBuilderException {
}

Model readFileModel() throws ModelBuilderException {
result.setSource(request.getSource());
Model model = cache(request.getSource(), FILE, this::doReadFileModel);
// set the file model in the result outside the cache
result.setFileModel(model);
return model;
}
Expand Down Expand Up @@ -1267,11 +1268,8 @@ Model doReadFileModel() throws ModelBuilderException {
throw e;
}

Severity severity = request.getRequestType() == ModelBuilderRequest.RequestType.BUILD_POM
? Severity.ERROR
: Severity.WARNING;
add(
severity,
Severity.ERROR,
ModelProblem.Version.V20,
"Malformed POM " + modelSource.getLocation() + ": " + e.getMessage(),
e);
Expand Down Expand Up @@ -1403,8 +1401,10 @@ Model doReadFileModel() throws ModelBuilderException {
}

Model readRawModel() throws ModelBuilderException {
// ensure file model is available
readFileModel();
Model model = cache(request.getSource(), RAW, this::doReadRawModel);
// set the raw model in the result outside the cache
result.setRawModel(model);
return model;
}
Expand Down

0 comments on commit be716a4

Please sign in to comment.