InputStream inputStream = null;
try {
inputStream = new FileInputStream(pomFile);
return IOUtils.toString(inputStream, encoding);
} catch (UnsupportedEncodingException ex) {
throw new FailureException("Could not handle encoding: " + encoding, ex);
} catch (IOException ex) {
throw new FailureException("Could not read pom file: " + pomFile.getAbsolutePath(), ex);
} finally {
IOUtils.closeQuietly(inputStream);
}
}