mongock: Mongock build AOT fail in Spring Boot 3.0.1
Description
Mongock build AOT fail in Spring Boot 3.0.1
Mongock
<dependency>
<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
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 16 (9 by maintainers)
I put together a small
AOTenabled mongock with Spring Data sample. The most interesting classes arecom.example.graph.nativex.ChangeUnitBeanFactoryInitializationAotProcessorcom.example.graph.repository.MongoDBConfigurationcom.example.graph.repository.MongockRunnerSupportcom.example.graph.spring.EnableMongockChangeUnitcom.example.graph.spring.MongockBeanDefinitionRegistrarIn the next major release we’ll provide official support, but it won’t be in this first quarter. Probably, starting Q2
We wanted to provide official support in the next major release. However, this is getting more and more attention and we won’t be able to contain it much longer. So we have decided to provide a decent workaround to allow you guys to carry on working and add it in the next release as part of the core.
We did a POC to check the work needed and we are confident in releasing the workaround soon.
Sorry, we under estimate it, not because it’s complex, we know what we need to do, but because we have a lot in our plates. I will notify you when it is ready 😃
Hello, we are working on a workaround for this. We expect to have it at the end of this week, beginning of next week.