diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java index 247187a44f..4c8fd0e95f 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java @@ -78,8 +78,12 @@ public class Repackager { } public Repackager(File source, LayoutFactory layoutFactory) { - if (source == null || !source.exists() || !source.isFile()) { - throw new IllegalArgumentException("Source must refer to an existing file"); + if (source == null) { + throw new IllegalArgumentException("Source file must be provided"); + } + if (!source.exists() || !source.isFile()) { + throw new IllegalArgumentException("Source must refer to an existing file, " + + "got " + source.getAbsolutePath()); } this.source = source.getAbsoluteFile(); this.layoutFactory = layoutFactory;