-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Description
Assume the application production code was build with the spring-boot:process-aot
goal executed in Maven or equivalent task in Gradle. This production application code contains Spring Data AOT JPA repositories.
If later the tests for this application are compiled via mvn test-compile
with the spring-boot:process-test-aot
, then the exception occurs, likely due to the fact the Spring Data AOT Repositories were generated in process-aot
step already and then process-test-aot
tries to do the same.
To reproduce - if we would run basic mvn clear package
with process-aot
and process-test-aot
as parts of the build as well for the Spring PetClinic with the 4.0.0-M1 as the parent (I'll open PR shortly in PetClinic for that), we would get the following error:
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)
It is not immediately clear how this issue should be even addressed. I'm sorry if this issue should not reside in the Spring Boot domain at all, just created it to keep track of this.