Skip to content

Commit a0f273a

Browse files
nilshartmannsnicoll
authored andcommitted
Explicit error message if source is not an archive
This commit split the existing assertion to provide an explicit error message if the source file is not an archive. See gh-31997
1 parent 2550763 commit a0f273a

File tree

1 file changed

+2
-1
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/main/java/org/springframework/boot/jarmode/layertools

1 file changed

+2
-1
lines changed

spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/main/java/org/springframework/boot/jarmode/layertools/Context.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class Context {
5555
* @param workingDir the working directory
5656
*/
5757
Context(File archiveFile, File workingDir) {
58-
Assert.state(isExistingFile(archiveFile) && isJarOrWar(archiveFile), "Unable to find source archive");
58+
Assert.state(isExistingFile(archiveFile), "Unable to find source archive");
59+
Assert.state(isJarOrWar(archiveFile), "Source archive doesn't end with .jar or .war");
5960
this.archiveFile = archiveFile;
6061
this.workingDir = workingDir;
6162
this.relativeDir = deduceRelativeDir(archiveFile.getParentFile(), this.workingDir);

0 commit comments

Comments
 (0)