-
Notifications
You must be signed in to change notification settings - Fork 65
Description
Description
Mongock build AOT fail in Spring Boot 3.0.1
Mongock
<groupId>io.mongock</groupId>
<artifactId>mongock-springboot-v3</artifactId>
<version>5.2.1</version>
</dependency>
<dependency>
<groupId>io.mongock</groupId>
<artifactId>mongodb-springdata-v4-driver</artifactId>
<version>5.2.1</version>
</dependency>
Environment
- Spring boot 3.0.1, graalvm-ce-17(version 17.0.5)
Steps to Reproduce
- Run cli
mvn spring-boot:process-aot
Behaviour
Actual behavior:
Constructor binding in a native image requires compilation with -parameters but the following classes were compiled without it: io.mongock.driver.mongodb.springdata.v4.config.MongoDBConfiguration$WriteConcernLevel
Link to repository using Mongock
[While not mandatory, accessing to the real code that uses Mongock, would help to solve the issue]
Additional context
Log
. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )__ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' || .__|| ||| |_, | / / / /
=========||==============|/=////
:: Spring Boot :: (v3.0.1)
11:59:21.451 [main] INFO vn.dolenglish.exercise.Application - No active profile set, falling back to 1 default profile: "default"
11:59:22.035 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data MongoDB repositories in DEFAULT mode.
11:59:22.068 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 30 ms. Found 8 MongoDB repository interfaces.
11:59:22.358 [main] INFO o.s.cloud.context.scope.GenericScope - BeanFactory id=a4ba64fd-1372-3075-bf0e-03f8404705bc
Constructor binding in a native image requires compilation with -parameters but the following classes were compiled without it:
io.mongock.driver.mongodb.springdata.v4.config.MongoDBConfiguration$WriteConcernLevel
at org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar.registerHints(BindableRuntimeHintsRegistrar.java:87)
at org.springframework.boot.context.properties.ConfigurationPropertiesBeanFactoryInitializationAotProcessor$ConfigurationPropertiesReflectionHintsContribution.applyTo(ConfigurationPropertiesBeanFactoryInitializationAotProcessor.java:70)
at org.springframework.context.aot.BeanFactoryInitializationAotContributions.applyTo(BeanFactoryInitializationAotContributions.java:78)
at org.springframework.context.aot.ApplicationContextAotGenerator.lambda$processAheadOfTime$0(ApplicationContextAotGenerator.java:58)
at org.springframework.context.aot.ApplicationContextAotGenerator.withCglibClassHandler(ApplicationContextAotGenerator.java:67)
at org.springframework.context.aot.ApplicationContextAotGenerator.processAheadOfTime(ApplicationContextAotGenerator.java:53)
at org.springframework.context.aot.ContextAotProcessor.performAotProcessing(ContextAotProcessor.java:106)
at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:84)
at org.springframework.context.aot.ContextAotProcessor.doProcess(ContextAotProcessor.java:49)
at org.springframework.context.aot.AbstractAotProcessor.process(AbstractAotProcessor.java:82)
at org.springframework.boot.SpringApplicationAotProcessor.main(SpringApplicationAotProcessor.java:76)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.577 s