Use graal metadata repository

- New version 0.1.1 now enabled in sample.
- Remove hibernate validator hints as those are
  in metadata repo.
- Relates #490
This commit is contained in:
Janne Valkealahti
2022-08-19 08:09:06 +01:00
parent 310cbf84a0
commit 52baaa3f86
2 changed files with 6 additions and 15 deletions

View File

@@ -16,6 +16,12 @@ springBoot {
buildInfo()
}
graalvmNative {
metadataRepository {
version = "0.1.1"
}
}
// TODO: workaround until boot's aot plugin automatically extends
// from all super configurations like graalvm's plugin does.
configurations {

View File

@@ -25,7 +25,6 @@ import org.springframework.aot.hint.ResourceHints;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeReference;
import org.springframework.util.ClassUtils;
public class SamplesRuntimeHints implements RuntimeHintsRegistrar {
@@ -58,20 +57,6 @@ public class SamplesRuntimeHints implements RuntimeHintsRegistrar {
"org.jline.terminal.impl.jna.win.Kernel32$FOCUS_EVENT_RECORD",
"org.jline.terminal.impl.jna.win.Kernel32$SMALL_RECT",
"org.jline.terminal.impl.jna.win.Kernel32$UnionChar");
// from spring-native sb-3.0.x branch
registerHibernateValidatorHints(hints, classLoader);
}
private void registerHibernateValidatorHints(RuntimeHints hints, ClassLoader classLoader) {
if (!ClassUtils.isPresent("org.hibernate.validator.HibernateValidator", classLoader)) {
return;
}
hints.reflection().registerType(TypeReference.of("org.hibernate.validator.internal.util.logging.Log_$logger"),
hint -> hint.withMembers(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS));
hints.reflection().registerType(
TypeReference.of("org.hibernate.validator.internal.util.logging.Messages_$bundle"),
hint -> hint.withField("INSTANCE", fieldHint -> {
}));
}
private void registerResources(ResourceHints resource) {