Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nhmarujo committed Jun 12, 2023
1 parent 1080e5b commit f9109c7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pom.xml
Expand Up @@ -16,7 +16,17 @@
<properties>
<java.version>17</java.version>
<spring-cloud.version>2022.0.3</spring-cloud.version>
<spring-framework.version>6.0.10-SNAPSHOT</spring-framework.version>
</properties>

<repositories>
<repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/snapshot</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/sample/jksnative/JksNativeApplication.java
Expand Up @@ -10,6 +10,8 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.aot.hint.MemberCategory.INVOKE_DECLARED_CONSTRUCTORS;

@SpringBootApplication
@ImportRuntimeHints(JksNativeApplication.NativeConfiguration.class)
public class JksNativeApplication {
Expand All @@ -20,6 +22,8 @@ public static void main(String[] args) {
public static class NativeConfiguration implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
hints.reflection()
.registerTypeIfPresent(classLoader, "org.springframework.security.rsa.crypto.RsaSecretEncryptor", INVOKE_DECLARED_CONSTRUCTORS);
hints.resources()
.registerPattern("application.yml")
.registerResource(new ClassPathResource("keystore.jks"));
Expand Down

0 comments on commit f9109c7

Please sign in to comment.