You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue originates from this Spring Boot ticket. Stéphane stated that this issue should be re-opened here, so I did.
The full story behind the question can be read in the original ticket, but the idea is that when in Spring Boot tests we have multiple versions of cached contexts being build, then AOT generation engine fails with exception:
Caused by: java.lang.IllegalStateException: /home/user/OpenSource/spring-petclinic/target/spring-aot/test/sources/org/springframework/samples/petclinic/owner/OwnerRepositoryImpl__Aot.java already exists
at org.springframework.aot.generate.GeneratedFiles$FileHandler.create(GeneratedFiles.java:279)
at org.springframework.aot.generate.GeneratedFiles.lambda$addFile$1(GeneratedFiles.java:170)
We concluded, that this is probably because for each test context, the engine tries to re-generate the Spring Data AOT repositories fragments.
Small addition: I tend to believe the conclusion, since when I've ensured that only one test context is created in Spring PetClinic, then AOT generation goes just fine (including AOT Repositories). Here is the branch in Spring PetClinic's fork that've used for this small testing purposes.
I'm willing to contribute, if core team would allow.