Search in sources :

Example 6 with ModelBuildingRequest

use of org.apache.maven.model.building.ModelBuildingRequest 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);
    }
}
Also used : ModelBuilder(org.apache.maven.model.building.ModelBuilder) ModelBuildingRequest(org.apache.maven.model.building.ModelBuildingRequest) DefaultModelBuildingRequest(org.apache.maven.model.building.DefaultModelBuildingRequest) ModelBuildingResult(org.apache.maven.model.building.ModelBuildingResult) DefaultModelBuildingRequest(org.apache.maven.model.building.DefaultModelBuildingRequest) Model(org.apache.maven.model.Model) ModelBuildingException(org.apache.maven.model.building.ModelBuildingException)

Aggregations

DefaultModelBuildingRequest (org.apache.maven.model.building.DefaultModelBuildingRequest)6 ModelBuildingRequest (org.apache.maven.model.building.ModelBuildingRequest)6 Model (org.apache.maven.model.Model)4 DefaultModelBuilderFactory (org.apache.maven.model.building.DefaultModelBuilderFactory)3 ModelBuildingException (org.apache.maven.model.building.ModelBuildingException)3 ModelBuilder (org.apache.maven.model.building.ModelBuilder)2 ModelBuildingResult (org.apache.maven.model.building.ModelBuildingResult)2 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 NoSuchFileException (java.nio.file.NoSuchFileException)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Properties (java.util.Properties)1 ProjectParseException (meghanada.project.ProjectParseException)1 RepositoryAdminException (org.apache.archiva.admin.model.RepositoryAdminException)1 NetworkProxy (org.apache.archiva.admin.model.beans.NetworkProxy)1 ProxyConnector (org.apache.archiva.admin.model.beans.ProxyConnector)1