use of org.apache.maven.model.building.ModelBuilder in project buck by facebook.
the class Pom method constructModel.
private Model constructModel(File file, Model model) {
ModelBuilder modelBuilder = MODEL_BUILDER_FACTORY.newInstance();
try {
ModelBuildingRequest req = new DefaultModelBuildingRequest().setPomFile(file);
ModelBuildingResult modelBuildingResult = modelBuilder.build(req);
Model constructed = Preconditions.checkNotNull(modelBuildingResult.getRawModel());
return merge(model, constructed);
} catch (ModelBuildingException e) {
throw new RuntimeException(e);
}
}
Aggregations