Not throwing exception when pom is missing'

This commit is contained in:
Marcin Grzejszczak
2018-10-31 11:31:15 +01:00
parent 412b78311d
commit 56536bbfd2
5 changed files with 17 additions and 4 deletions

View File

@@ -38,6 +38,9 @@ class PomReader {
if (file.isDirectory()) {
pom = new File(file,"pom.xml");
}
if (!pom.exists()) {
return null;
}
String fileText = "";
try(Reader reader = new FileReader(pom)) {
if (file.isFile()) {

View File

@@ -68,6 +68,10 @@ class PomUpdater {
return false;
}
Model model = this.pomReader.readPom(rootPom);
if (model == null) {
log.info("Failed to read the model");
return false;
}
String artifactId = artifactId(model);
if (!versions.shouldBeUpdated(artifactId)) {
log.info("Skipping project [{}] since it's not on the list of projects to update", model.getArtifactId());