Improve error message with Maven build-image and war packaging

Fixes gh-24522
This commit is contained in:
Scott Frederick
2020-12-16 12:06:12 -06:00
parent 2cd1459a9a
commit e4d124dc45
5 changed files with 93 additions and 2 deletions

View File

@@ -180,7 +180,11 @@ public class BuildImageMojo extends AbstractPackagerMojo {
name.append("-").append(this.classifier);
}
name.append(".jar");
return new File(this.sourceDirectory, name.toString());
File jarFile = new File(this.sourceDirectory, name.toString());
if (!jarFile.exists()) {
throw new IllegalStateException("Executable jar file required for building image");
}
return jarFile;
}
private BuildRequest customize(BuildRequest request) {