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

Fix Spring Boot 2.7.6+ compatiblity #1740

Closed fbus closed 1 year ago

fbus commented 1 year ago

As far as I can tell, this commit broke compatibility with spring native : https://github.com/spring-projects/spring-boot/commit/463a614d271bfc82602cecaf9863413b0566526a

It was working fine with 2.7.5. Now with 2.7.6 I get errors like

[INFO] --- spring-aot-maven-plugin:0.12.1:generate (generate) @ integrationtest-artifactId-api ---
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/ApplicationServletEnvironment
        at org.springframework.boot.AotApplicationContextFactory.getOrCreateEnvironment(AotApplicationContextFactory.java:80)
[INFO] --- spring-aot-maven-plugin:0.12.1:generate (generate) @ integrationtest-artifactId-api ---
Exception in thread "main" java.lang.NoSuchMethodError: 'org.springframework.core.env.StandardEnvironment org.springframework.boot.EnvironmentConverter.convertEnvironmentIfNecessary(org.springframework.core.env.ConfigurableEnvironment, java.lang.Class)'
        at org.springframework.boot.AotApplicationContextFactory.loadEnvironment(AotApplicationContextFactory.java:68)
        at org.springframework.boot.AotApplicationContextFactory.createApplicationContext(AotApplicationContextFactory.java:52)

I understand that spring native 0.12 is not supported since spring boot 3 is released. I won't make the jump to 3.0 until 6 months at least in my company so... If possible, a 0.12.2 release would be appreciated :D Merci !