class Extension {

    protected Model getRootPomFile(File folder) throws IOException, XmlPullParserException {
        FileInputStream fileInputStream = null;
        Model model;

        try {
            MavenXpp3Reader reader = new MavenXpp3Reader();
            File pomFile = new File(folder, "pom.xml");
            fileInputStream = new FileInputStream(pomFile);
            model = reader.read(fileInputStream);
        } finally {
            if (fileInputStream != null) try {
                fileInputStream.close();
            } catch (IOException e) {
                logger.error("Error happened when trying to close file", e);
            }
        }

        return model;
    }

}