Skip to content

Commit 86303c0

Browse files
Merge branch '2.4.x'
Closes gh-25938
2 parents 5ca4cc9 + 9108b81 commit 86303c0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchive.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ private void assertArchiveHasEntries(File jarFile) {
8080
+ "' is not compatible with buildpacks; ensure jar file is valid and launch script is not enabled");
8181
}
8282
catch (IOException ex) {
83-
throw new IllegalStateException("File is not readable", ex);
83+
throw new IllegalStateException("File '" + jarFile + "' is not readable", ex);
8484
}
8585
}
8686

@@ -99,6 +99,7 @@ private TarArchiveEntry convert(ZipArchiveEntry zipEntry) {
9999
tarEntry.setUserId(this.owner.getUid());
100100
tarEntry.setGroupId(this.owner.getGid());
101101
tarEntry.setModTime(NORMALIZED_MOD_TIME);
102+
tarEntry.setMode(zipEntry.getUnixMode());
102103
if (!zipEntry.isDirectory()) {
103104
tarEntry.setSize(zipEntry.getSize());
104105
}

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@
3636
* Tests for {@link ZipFileTarArchive}.
3737
*
3838
* @author Phillip Webb
39+
* @author Scott Frederick
3940
*/
4041
class ZipFileTarArchiveTests {
4142

@@ -75,6 +76,7 @@ void writeToAdaptsContent() throws Exception {
7576
assertThat(fileEntry.getLongUserId()).isEqualTo(123);
7677
assertThat(fileEntry.getLongGroupId()).isEqualTo(456);
7778
assertThat(fileEntry.getSize()).isEqualTo(4);
79+
assertThat(fileEntry.getMode()).isEqualTo(0755);
7880
assertThat(tarStream).hasContent("test");
7981
}
8082
}
@@ -85,6 +87,7 @@ private void writeTestZip(File file) throws IOException {
8587
zip.putArchiveEntry(dirEntry);
8688
zip.closeArchiveEntry();
8789
ZipArchiveEntry fileEntry = new ZipArchiveEntry("spring/boot");
90+
fileEntry.setUnixMode(0755);
8891
zip.putArchiveEntry(fileEntry);
8992
zip.write("test".getBytes(StandardCharsets.UTF_8));
9093
zip.closeArchiveEntry();

0 commit comments

Comments
 (0)