Display exception cause if possible
Fixes
@@ -296,9 +296,13 @@ public class BuildMojo extends io.fabric8.maven.docker.BuildMojo {
fabric8ServiceHub.getBuildService().build(imageConfig);
} catch (Exception ex) {
+ if (ex.getCause() != null) {
+ throw new MojoExecutionException("Failed to execute the build: " + ex.getCause());
+ } else {
throw new MojoExecutionException("Failed to execute the build: " + ex);
}
}
+ }
protected BuildService.BuildServiceConfig getBuildServiceConfig() throws MojoExecutionException {
return new io.fabric8.maven.core.service.BuildService.BuildServiceConfig.Builder()
