mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Support getPermissions() call on Gradle 8.6-milestone-1
The `getPermissions` method is now part of the private `ParentDirectoryStub` class so we now need to call `setAccessible(true)`. Fixes gh-38718
This commit is contained in:
parent
52baf0003b
commit
39bc7c8582
@ -22,6 +22,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.lang.reflect.Method;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.Collection;
|
||||
@ -462,7 +463,9 @@ class BootZipCopyAction implements CopyAction {
|
||||
private int getPermissions(FileCopyDetails details) {
|
||||
if (GradleVersion.current().compareTo(GradleVersion.version("8.3")) >= 0) {
|
||||
try {
|
||||
Object permissions = details.getClass().getMethod("getPermissions").invoke(details);
|
||||
Method getPermissionsMethod = details.getClass().getMethod("getPermissions");
|
||||
getPermissionsMethod.setAccessible(true);
|
||||
Object permissions = getPermissionsMethod.invoke(details);
|
||||
return (int) permissions.getClass().getMethod("toUnixNumeric").invoke(permissions);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user