From 798dd4fec00829ac8f4b9036aea38c0507925c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Mon, 27 Jun 2022 17:33:14 +0200 Subject: [PATCH] Add missing build time class initialization As gh-28624 supports only static boolean fields, we still need a few classes to be initialized at build time. Such explicit configuration should be in theory avoidable, so we will work with the GraalVM team to see if this can be fixed, see for example https://github.com/oracle/graal/issues/4673 for HttpStatus. See gh-28624 --- .../org.springframework/spring-core/native-image.properties | 1 - .../org.springframework/spring-core/native-image.properties | 5 +++++ .../org.springframework/spring-web/native-image.properties | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) delete mode 100644 spring-core/graalvm/src/main/resources/META-INF/native-image/org.springframework/spring-core/native-image.properties create mode 100644 spring-core/src/main/resources/META-INF/native-image/org.springframework/spring-core/native-image.properties create mode 100644 spring-web/src/main/resources/META-INF/native-image/org.springframework/spring-web/native-image.properties diff --git a/spring-core/graalvm/src/main/resources/META-INF/native-image/org.springframework/spring-core/native-image.properties b/spring-core/graalvm/src/main/resources/META-INF/native-image/org.springframework/spring-core/native-image.properties deleted file mode 100644 index 46311113d35..00000000000 --- a/spring-core/graalvm/src/main/resources/META-INF/native-image/org.springframework/spring-core/native-image.properties +++ /dev/null @@ -1 +0,0 @@ -Args = --initialize-at-build-time=org.springframework.aot.graalvm.ThrowawayClassLoader \ No newline at end of file diff --git a/spring-core/src/main/resources/META-INF/native-image/org.springframework/spring-core/native-image.properties b/spring-core/src/main/resources/META-INF/native-image/org.springframework/spring-core/native-image.properties new file mode 100644 index 00000000000..e6881ff52f1 --- /dev/null +++ b/spring-core/src/main/resources/META-INF/native-image/org.springframework/spring-core/native-image.properties @@ -0,0 +1,5 @@ +Args = --initialize-at-build-time=org.springframework.aot.graalvm.ThrowawayClassLoader,\ +org.springframework.util.ClassUtils,\ +org.springframework.util.ConcurrentReferenceHashMap,\ +org.springframework.util.MimeType,\ +org.springframework.util.MimeTypeUtils diff --git a/spring-web/src/main/resources/META-INF/native-image/org.springframework/spring-web/native-image.properties b/spring-web/src/main/resources/META-INF/native-image/org.springframework/spring-web/native-image.properties new file mode 100644 index 00000000000..2c3c113a9e1 --- /dev/null +++ b/spring-web/src/main/resources/META-INF/native-image/org.springframework/spring-web/native-image.properties @@ -0,0 +1,2 @@ +Args = --initialize-at-build-time=org.springframework.http.HttpStatus,\ +org.springframework.http.MediaType