diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml
index d068f4b4..2233083c 100644
--- a/spring-cloud-config-server/pom.xml
+++ b/spring-cloud-config-server/pom.xml
@@ -87,6 +87,12 @@
org.eclipse.jgit
org.eclipse.jgit.ssh.apache
+
+
+ org.apache.sshd
+ sshd-sftp
+
+
org.yaml
diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerAutoConfiguration.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerAutoConfiguration.java
index 1cf57550..75c32e1b 100644
--- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerAutoConfiguration.java
+++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/config/ConfigServerAutoConfiguration.java
@@ -16,11 +16,30 @@
package org.springframework.cloud.config.server.config;
+import java.util.Set;
+
+import org.eclipse.jgit.api.CheckoutCommand;
+import org.eclipse.jgit.api.MergeCommand;
+import org.eclipse.jgit.internal.JGitText;
+import org.eclipse.jgit.lib.CoreConfig;
+import org.eclipse.jgit.util.sha1.SHA1;
+
+import org.springframework.aot.hint.MemberCategory;
+import org.springframework.aot.hint.RuntimeHints;
+import org.springframework.aot.hint.RuntimeHintsRegistrar;
+import org.springframework.aot.hint.TypeReference;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.cloud.config.environment.PropertyValueDescriptor;
+import org.springframework.cloud.config.server.ssh.HostKeyAlgoSupportedValidator;
+import org.springframework.cloud.config.server.ssh.HostKeyAndAlgoBothExistValidator;
+import org.springframework.cloud.config.server.ssh.KnownHostsFileValidator;
+import org.springframework.cloud.config.server.ssh.PrivateKeyValidator;
+import org.springframework.cloud.config.server.ssh.SshPropertyValidator;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
+import org.springframework.util.ClassUtils;
/**
* @author Spencer Gibb
@@ -35,3 +54,33 @@ import org.springframework.context.annotation.Import;
public class ConfigServerAutoConfiguration {
}
+
+class ConfigServerHints implements RuntimeHintsRegistrar {
+
+ @Override
+ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
+ if (!ClassUtils.isPresent("org.springframework.cloud.config.server.config.ConfigServerConfiguration",
+ classLoader)) {
+ return;
+ }
+ hints.reflection().registerTypes(Set.of(TypeReference.of(HostKeyAndAlgoBothExistValidator.class),
+ TypeReference.of(KnownHostsFileValidator.class), TypeReference.of(HostKeyAlgoSupportedValidator.class),
+ TypeReference.of(PrivateKeyValidator.class), TypeReference.of(SshPropertyValidator.class)),
+ hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS))
+ .registerType(TypeReference.of(PropertyValueDescriptor.class),
+ hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.DECLARED_FIELDS,
+ MemberCategory.INTROSPECT_DECLARED_CONSTRUCTORS))
+ // TODO: move over to GraalVM metadata
+ .registerTypes(Set.of(TypeReference.of(CheckoutCommand.class),
+ TypeReference.of(MergeCommand.FastForwardMode.Merge.class),
+ TypeReference.of(MergeCommand.ConflictStyle.class),
+ TypeReference.of(MergeCommand.FastForwardMode.class), TypeReference.of(JGitText.class),
+ TypeReference.of(CoreConfig.AutoCRLF.class), TypeReference.of(CoreConfig.EOL.class),
+ TypeReference.of(CoreConfig.CheckStat.class), TypeReference.of(CoreConfig.HideDotFiles.class),
+ TypeReference.of(CoreConfig.LogRefUpdates.class), TypeReference.of(CoreConfig.SymLinks.class),
+ TypeReference.of(CoreConfig.TrustPackedRefsStat.class), TypeReference.of(CoreConfig.class),
+ TypeReference.of(SHA1.class), TypeReference.of(SHA1.Sha1Implementation.class)),
+ hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_METHODS, MemberCategory.PUBLIC_FIELDS));
+ }
+
+}
diff --git a/spring-cloud-config-server/src/main/resources/META-INF/native-image/org.springframework.cloud/spring-cloud-config-server/native-image.properties b/spring-cloud-config-server/src/main/resources/META-INF/native-image/org.springframework.cloud/spring-cloud-config-server/native-image.properties
new file mode 100644
index 00000000..f615cbe8
--- /dev/null
+++ b/spring-cloud-config-server/src/main/resources/META-INF/native-image/org.springframework.cloud/spring-cloud-config-server/native-image.properties
@@ -0,0 +1,8 @@
+Args = --initialize-at-build-time=ch.qos.logback.classic.Logger \
+--initialize-at-build-time=ch.qos.logback.core.status.StatusBase \
+--initialize-at-build-time=ch.qos.logback.core.util.StatusPrinter \
+--initialize-at-build-time=org.slf4j.LoggerFactory \
+--initialize-at-build-time=ch.qos.logback.core.status.InfoStatus \
+--initialize-at-build-time=ch.qos.logback.classic.Level \
+--initialize-at-build-time=ch.qos.logback.core.util.Loader \
+--initialize-at-build-time=org.apache.commons.logging.impl.SLF4JLogFactory
diff --git a/spring-cloud-config-server/src/main/resources/META-INF/spring/aot.factories b/spring-cloud-config-server/src/main/resources/META-INF/spring/aot.factories
new file mode 100644
index 00000000..ec7eb8b6
--- /dev/null
+++ b/spring-cloud-config-server/src/main/resources/META-INF/spring/aot.factories
@@ -0,0 +1,2 @@
+org.springframework.aot.hint.RuntimeHintsRegistrar=\
+org.springframework.cloud.config.server.config.ConfigServerHints