spring-attic / spring-native

Spring Native is now superseded by Spring Boot 3 official native support
https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html
Apache License 2.0
2.74k stars 356 forks source link

Gradle AOT plugin removes generated sources that don't belong to it #1704

Closed edudar closed 2 years ago

edudar commented 2 years ago

I've been trying to figure out why my IDE does not recognize QueryDSL's Q classes. I see class files compiled from supposedly generated sources but no source files.

I found this issue #623 where the fix was to take everything in "generated" and remove it recursively. That seems to be quite an overstep by the AOT plugin as it removes sources generated by other tools.

I'd suggest removing sources that belong to the AOT plugin only, such as starting with aot like aotMain and aotTest

To verify that, I created an empty dir build/generated/testDir, started the build, and my dir was gone.

sdeleuze commented 2 years ago

Sounds legit but as we focus on Spring Boot 3 native support, we prefer to use our bandwidth on this upcoming non-experimental support. I would suggest to double check that Spring Boot 3 snapshots provide the right behavior, you can create such project on https://start.spring.io/ and run for example mvn -Pnative package, should work out of the box with GraalVM 22.2 native-image installed locally.