Skip to content

Commit

Permalink
fix issue quarkusio#29770: always store raw model into cache
Browse files Browse the repository at this point in the history
(cherry picked from commit 86e6600)
  • Loading branch information
benstonezhang authored and gsmet committed Dec 20, 2022
1 parent a36fb21 commit 7b71598
Showing 1 changed file with 4 additions and 6 deletions.
Expand Up @@ -153,13 +153,11 @@ private LocalProject loadAndCacheProject(Path pomFile) throws BootstrapMavenExce
}

private Model rawModel(Path pomFile) throws BootstrapMavenException {
final Model rawModel = rawModelCache.getOrDefault(pomFile.getParent(),
Model rawModel = rawModelCache.getOrDefault(pomFile.getParent(),
modelProvider == null ? null : modelProvider.apply(pomFile.getParent()));
return rawModel == null ? loadAndCacheRawModel(pomFile) : rawModel;
}

private Model loadAndCacheRawModel(Path pomFile) throws BootstrapMavenException {
final Model rawModel = readModel(pomFile);
if (rawModel == null) {
rawModel = readModel(pomFile);
}
rawModelCache.put(pomFile.getParent(), rawModel);
return rawModel;
}
Expand Down

0 comments on commit 7b71598

Please sign in to comment.