-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Labels
Description
Version Info
java:17
spring-boot:3.0.1
spring-framework:6.0.3
spring-guice:2.0.2
native-maven-plugin:0.9.19
Description
I followed the requirements of the SpringBoot3 native-image document and made relevant configuration.
like this:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<mainClass>${mainClass}</mainClass>
</configuration>
<executions>
<execution>
<configuration>
<jvmArguments>
<!-- -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005-->
</jvmArguments>
</configuration>
<id>process-aot</id>
<goals>
<goal>process-aot</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${native-maven-plugin.version}</version>
</plugin>
But encountered java.lang.IllegalArgumentException: Code generation does not support com.google.inject.Key<?>
when execute spring-boot-maven-plugin#process-aot
BeanDefinitionPropertyValueCodeGenerator#generateCode
private CodeBlock generateCode(@Nullable Object value, ResolvableType type) {
if (value == null) {
return NULL_VALUE_CODE_BLOCK;
}
for (Delegate delegate : this.delegates) {
CodeBlock code = delegate.generateCode(value, type);
if (code != null) {
return code;
}
}
throw new IllegalArgumentException("Code generation does not support " + type);
}